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:
GitHub Actions
2026-04-19 23:19:52 +08:00
parent e208025f35
commit c67a9c3d61
3 changed files with 9 additions and 7 deletions

View File

@@ -896,15 +896,15 @@ class LingmaGatewayClient:
is_reply: bool = False,
tool_config: dict[str, Any] | None = None,
):
session_type = "developer" if ask_mode == "agent" else "chat"
session_type = "ask" if ask_mode == "agent" else "chat"
payload = {
"requestId": request_id,
"sessionId": session_id,
"sessionType": session_type,
"chatTask": "FREE_INPUT",
"chatTask": "chat" if ask_mode == "agent" else "FREE_INPUT",
"mode": ask_mode,
"stream": True,
"source": 1,
"source": "vscode" if ask_mode == "agent" else 1,
"isReply": is_reply,
"taskDefinitionType": "system",
"content": prompt,