feat: add emulated tool-calling bridge for Lingma
Add a proxy-side tool emulation layer so Lingma requests can surface stable OpenAI tool_calls and Anthropic tool_use blocks even when upstream tool events are missing or inconsistent. Constraint: Keep native Lingma tool event bridging as the first path and layer emulation as a fallback Rejected: Depend exclusively on Lingma native tool/invoke events | tool visibility remains inconsistent across models and transports Confidence: high Scope-risk: moderate
This commit is contained in:
@@ -419,6 +419,17 @@ class LspWsRpcClient:
|
||||
method = msg.get("method")
|
||||
params = msg.get("params") or {}
|
||||
|
||||
if method and (
|
||||
method.startswith("tool/")
|
||||
or method.startswith("mcp/")
|
||||
or method in {"chat/answer", "chat/finish"}
|
||||
):
|
||||
logger.info(
|
||||
"lingma server message method=%s params=%s",
|
||||
method,
|
||||
params,
|
||||
)
|
||||
|
||||
if method == "chat/answer":
|
||||
req_id = params.get("requestId")
|
||||
stream = self._chat_streams.get(req_id)
|
||||
|
||||
Reference in New Issue
Block a user