Conversation
…epSeek DeepSeek's OpenAI-compatible API only supports response_format json_object; title generation sends json_schema and 400s with 'This response_format type is unavailable now'. Downgrade the response_format in the auxiliary kwargs merge point when the provider or base_url is DeepSeek, so aux tasks keep working without pinning a non-DeepSeek model.
Right compatibility shim, correctly scoped: provider-name OR api.deepseek.com host matching (so custom providers pointed at DeepSeek are covered), strict equality on the
No blocking issues found beyond confirming item 1's downstream parsers. |
Collaborator
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.
Bug Description
Auxiliary title generation fails on DeepSeek with HTTP 400:
Sessions get no model-generated title (only the instant derived title); the error is logged on every title attempt.
Root Cause
agent/title_generator.pysendsresponse_format: {"type": "json_schema", ...}viaextra_body(line 412). The DeepSeek API (api.deepseek.com) only supportsresponse_formatof typejson_object—json_schemais rejected with a hard 400 "This response_format type is unavailable now". Reproduced directly against the API:response_format: {"type": "json_schema", ...}→ 400This response_format type is unavailable nowresponse_format: {"type": "json_object"}→ 200_build_call_kwargsinagent/auxiliary_client.pypasses the caller'sextra_bodythrough untouched, so the unsupported type reaches the wire for every DeepSeek-based aux setup (auxiliary.*.provider: deepseek, the default for title_generation).Fix
In
agent/auxiliary_client.py::_build_call_kwargs, at theextra_bodymerge point, downgraderesponse_formatfromjson_schematojson_objectwhen the provider is DeepSeek (provider namedeepseek/aliases, or base_url hostapi.deepseek.com). Other providers keepjson_schemauntouched.The title extractor already tolerates
json_objectoutput (it parses the JSON object and falls back through a loose scan), so no title-quality regression on DeepSeek.How to Verify
auxiliary.title_generation.provider: deepseek(default).HTTP 400: This response_format type is unavailable nowinagent.log).Test Plan
tests/agent/test_auxiliary_client.py::TestDeepSeekJsonSchemaDowngrade(provider-name downgrade, base_url downgrade, other providers unaffected)tests/agent/test_auxiliary_client.pypasses (185 tests)分析磁盘流量日志目的IP和端口分布)Risk Assessment
Low — the change only rewrites
response_format.typefromjson_schematojson_objectwhen the request targets DeepSeek (by provider name orapi.deepseek.comhost). OpenAI/Anthropic/OpenRouter/etc. requests are byte-identical to before. DeepSeekjson_objectstill guarantees valid JSON output, which the title parser handles.