Conversation
…ction
Two-stage session titling sends response_format=json_schema, which some
providers (DeepSeek V4) reject with HTTP 400. The title task then returns
None and the raw derived title sticks forever, silently. Retry the title
call with {"type": "json_object"} when the strict call raises; the prompt
already demands a single JSON object and _extract_title_text tolerates
non-compliant output.
defgn
marked this pull request as ready for review
August 9, 2026 22:13
8 of 9 tasks
3 tasks done
viz-A-viz
added a commit
to viz-A-viz/hermes-agent
that referenced
this pull request
Aug 10, 2026
Title generation hardcodes a strict json_schema response_format with no fallback. Providers without structured-output support (DeepSeek returns HTTP 400 "This response_format type is unavailable now") fail the whole call and the session keeps its truncated derived name. Walk a constraint ladder instead: json_schema -> json_object -> no response_format, pinning thinking off on retries so default-on reasoning models (DeepSeek V4) don't burn the 64-token budget on reasoning and return an empty content field. Failures unrelated to response_format (auth, quota, network) break out immediately - a different format cannot fix those. Unlike the other open PRs for this bug (NousResearch#82073, NousResearch#82372, NousResearch#82751, NousResearch#82868, NousResearch#82890), the retried calls also send thinking: {"type": "disabled"} - without it DeepSeek answers with an empty content and the title still never appears, even though the 400 is gone.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two-stage session titling (instant derived title, then an LLM "upgrade" to a short summary) fails for providers that reject the strict
json_schemaresponse_format. DeepSeek V4 returns HTTP 400 ("This response_format type is unavailable now"), the title task returnsNone, and the raw derived title ([Display Name] first words…) sticks forever.Root cause
generate_titlesendsextra_body={"response_format": _TITLE_RESPONSE_FORMAT}(json_schema) unconditionally. Some providers only supportjson_object. Because callers treat aNonetitle as "keep the derived title", the failure is silent — no error surfaces to the user.Fix
Retry the title call with
{"type": "json_object"}when the json_schema call raises. The prompt already demands a single JSON object and_extract_title_text's loose scan tolerates non-compliant output, so the looser hint is safe.Verification
[Name] <first words…>; after → clean 3–7 word summaries land ~3s after thread creation.