fix(mcp): tag legacy provider calls with audit context
This commit is contained in:
@@ -34,14 +34,14 @@ MASTER §3.1 L6×D1
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import time
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
import structlog
|
||||
|
||||
from src.services.evidence_snapshot import EvidenceSnapshot
|
||||
from src.services.mcp_audit_context import with_mcp_audit_context
|
||||
from src.services.mcp_tool_registry import SensorDimension, get_mcp_tool_registry
|
||||
from src.services.sanitization_service import sanitize_dict_values
|
||||
from src.services.sanitization_service import sanitize, sanitize_dict_values
|
||||
# W2 PR-V1: 頂層 import 讓測試 patch 路徑固定(延遲 import 無法被 patch)
|
||||
# ENABLE_SELF_HEALING_VALIDATOR=False 時此 import 不影響效能(純 python 模組)
|
||||
from src.services import self_healing_validator as _shv_module
|
||||
@@ -216,8 +216,15 @@ class PostExecutionVerifier:
|
||||
|
||||
async def _call_one(reg) -> tuple[str, Any]:
|
||||
try:
|
||||
audited_params = with_mcp_audit_context(
|
||||
params,
|
||||
session_id=f"incident:{_get_incident_id(incident)}:post_execution",
|
||||
incident_id=_get_incident_id(incident),
|
||||
flywheel_node="verify",
|
||||
agent_role="post_execution_verifier",
|
||||
)
|
||||
result = await asyncio.wait_for(
|
||||
reg.provider.execute(reg.tool.name, params),
|
||||
reg.provider.execute(reg.tool.name, audited_params),
|
||||
timeout=TOOL_TIMEOUT_SEC,
|
||||
)
|
||||
if result.success and result.output:
|
||||
|
||||
Reference in New Issue
Block a user