Skip to content

fix(title): retry title generation without json_schema response_format when the provider rejects it - #93726

Closed
ZLF0621 wants to merge 1 commit into
NousResearch:mainfrom
ZLF0621:fix/title-deepseek-400-fallback
Closed

ZLF0621 wants to merge 1 commit into
NousResearch:mainfrom
ZLF0621:fix/title-deepseek-400-fallback

Conversation

@ZLF0621

@ZLF0621 ZLF0621 commented Aug 24, 2026

Copy link
Copy Markdown

Problem

Some OpenAI-compatible providers (notably DeepSeek) do not implement the json_schema response_format type and reject the request with HTTP 400 ("This response_format type is unavailable now"). Titling then fails silently and the session keeps the derived (un-upgraded) title. Reported in #83390.

Fix

Wrap the title-generation call and retry once without the json_schema response_format when the error mentions response_format or "unavailable". The prompt still demands JSON-only output, and the existing loose JSON scan in _extract_title_text falls back to first-line prose for anything non-compliant.

Validation

  • Reproduced the HTTP 400 on DeepSeek before the change; after it, title generation succeeds via the fallback path (verified locally against a real DeepSeek endpoint).
  • Full relay/title/clarify test set passes: 78 passed.

…t when the provider rejects it

Some OpenAI-compatible providers (notably DeepSeek) do not implement the
json_schema response_format type and reject the request with HTTP 400
("This response_format type is unavailable now"). Titling then fails
silently and the session is left with the derived title.

Retry once without the schema when the error mentions response_format or
"unavailable". The prompt still demands JSON-only output, and the
existing loose JSON scan falls back to first-line prose for anything
non-compliant.

Refs: #83390
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/deepseek DeepSeek API duplicate This issue or pull request already exists labels Aug 24, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Duplicate of #82890: both add the same focused one-time schema-free retry for title generation after a response_format rejection. #82890 remains the earlier open implementation.

@teknium1

Copy link
Copy Markdown
Collaborator

Thanks @ZLF0621 for working on the json_schema retry. This landed on main through #89589 and #113966 (5cc8177), which covers the same symptom on the primary and fallback auxiliary paths and omits the field up front for providers known to reject it. Closing as superseded by the landed fix — the tracking issue (#83390 cluster) is closed with the same references.

@teknium1 teknium1 closed this Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have provider/deepseek DeepSeek API type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants