Skip to content

fix: add "cannot determine type" to Responses API fallback markers#1763

Open
gdeyoung wants to merge 9 commits into
agent0ai:mainfrom
gdeyoung:fix/responses-fallback-cannot-determine-type
Open

fix: add "cannot determine type" to Responses API fallback markers#1763
gdeyoung wants to merge 9 commits into
agent0ai:mainfrom
gdeyoung:fix/responses-fallback-cannot-determine-type

Conversation

@gdeyoung

Copy link
Copy Markdown
Contributor

Problem

When an OpenAI-compatible server (e.g., llama.cpp) receives a Responses API request with complex input items it cannot parse, it returns:

400 - Cannot determine type of item

This is a shape-specific Bad Request indicating the provider cannot parse Responses payloads, which should trigger fallback to Chat Completions per the transport DOX contract (litellm_transport.py.dox.md line 30):

Fall back to Chat Completions when a Responses request is rejected before any output by an endpoint-specific or shape-specific Bad Request indicating the provider cannot parse Responses payloads.

The marker was missing from _looks_like_responses_request_rejected(), causing the transport to raise BadRequestError instead of falling back.

Fix

Added "cannot determine type" to the markers list in _looks_like_responses_request_rejected().

+            "cannot determine type",

Verification

Tested against llama.cpp server (Qwen3.6-27B) at http://192.168.1.243:11437/v1/responses:

  • Returns 400 with complex input items (multi-message format)
  • Returns 200 with simple string input
  • After patch: transport detects the 400 as a shape-specific rejection and falls back to /v1/chat/completions successfully

DOX Compliance

No DOX update needed — the contract at litellm_transport.py.dox.md already describes this behavior. The code was simply missing the marker to match the documented contract.

Agent Zero and others added 9 commits June 3, 2026 11:53
Fixed 10 broken tools (voice_stt, voice_tts, image_gen, video_gen, media_pipeline,
thinking_council, content_extraction, enrichment_tool, knowledge_manager, kg_dreamer)

Root causes found and fixed:
- helpers/ namespace collision (7 tools)
- Tool filename mismatch (7 tools)
- Missing Tool inheritance (3 tools)
- Extension filename deduplication (23 extensions renamed)
- kg_dreamer: syntax error + missing export + missing factories

Enforcement architecture:
- 23 uniquely-named tool_execute_before extensions
- 13 tools verified blocked from main agent
- Subordinates pass through freely

Other fixes:
- backup_manager SSH credential resolution (3-tier fallback)
- Deleted stale plugins/plugins/ mirror
- Deleted 7 empty helpers/ dirs
- Created 7 prompt files, kg_dreamer factories.py
- ulimit raised to 65536
- Platform: 20 registered tools, 64 skills, 50 plugins
When an OpenAI-compatible server (e.g., llama.cpp) receives a Responses API
request with complex input items it cannot parse, it returns:
400 - Cannot determine type of item

This is a shape-specific Bad Request indicating the provider cannot parse
Responses payloads, which should trigger fallback to Chat Completions per
the transport DOX contract (litellm_transport.py.dox.md line 30).

The marker was missing from _looks_like_responses_request_rejected(),
causing the transport to raise BadRequestError instead of falling back.

Verification: Tested against llama.cpp server (Qwen3.6-27B) at
http://192.168.1.243:11437/v1/responses - returns 400 with complex input
items, 200 with simple string input. After patch, transport falls back
to /v1/chat/completions successfully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants