Soften short-intent gates and add tool-result refs plus MCP wire invalidate.

Prefer report tools without hard-hiding CLI, keep soft CLI budgets, store compact+result_ref for the model, and clear frozen wire after MCP sync.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-08-12 21:48:05 +08:00
parent 3785e78a72
commit 605751b6a6
13 changed files with 636 additions and 65 deletions

View file

@ -3860,6 +3860,12 @@ def build_admin_router() -> APIRouter:
status="ok",
detail={"synced_tools": len(norm), "compat_mode": "bailian_webparser"},
)
try:
from runtime.direct_loop import invalidate_tool_wire_cache
invalidate_tool_wire_cache(reason=f"mcp_admin_sync:{server_id}")
except Exception:
pass
return {"ok": True, "server_id": server_id, "tools": norm, "compat_mode": "bailian_webparser"}
rt = mcp_runtime_for_row(row, store=store)
try:
@ -3883,6 +3889,12 @@ def build_admin_router() -> APIRouter:
)
store.replace_mcp_server_tools(server_id=server_id, tools=norm)
store.set_mcp_server_health(server_id=server_id, status="ok", detail={"synced_tools": len(norm)})
try:
from runtime.direct_loop import invalidate_tool_wire_cache
invalidate_tool_wire_cache(reason=f"mcp_admin_sync:{server_id}")
except Exception:
pass
return {"ok": True, "server_id": server_id, "tools": norm}
finally:
rt.stop()