fix: align agent payload semantics with VSCode tool flow
Force OpenAI tooling-context requests into agent mode and align Lingma ask payload fields for agent requests so server-side tool path matches VSCode semantics. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -504,13 +504,13 @@ async def v1_chat_completions(req: ChatCompletionsRequest, request: Request):
|
||||
# 1. Reuse the upstream sessionId so Lingma/Qwen hits its KV cache.
|
||||
# 2. Send only the new user message instead of the whole history.
|
||||
# 3. Stick the request to the pool instance that originally served it.
|
||||
ask_mode = settings.default_ask_mode
|
||||
if req.model.lower() in {"lingma-agent", "agent"}:
|
||||
ask_mode = "agent"
|
||||
|
||||
tool_config = _openai_tool_config(req)
|
||||
has_tooling_context = _openai_has_tooling_context(req, messages_dump)
|
||||
|
||||
ask_mode = settings.default_ask_mode
|
||||
if req.model.lower() in {"lingma-agent", "agent"} or has_tooling_context:
|
||||
ask_mode = "agent"
|
||||
|
||||
reuse_eligible = (
|
||||
session_cache.enabled
|
||||
and ask_mode == "chat"
|
||||
|
||||
Reference in New Issue
Block a user