chore(vocero): remove the legacy ApiPilot integration (#3)
Vocero now retrieves AquaPortal content through authenticated MCP. This removes the obsolete ApiPilot integration from the API and browser while preserving the separately deployed speech pipeline. Release notes: - Removed ApiPilot endpoints, configuration, credential overrides, and HTTP/realtime tool execution. - Removed browser ApiPilot catalog loading and prompt generation while retaining authenticated MCP discovery. - Updated regression coverage and operating documentation for the retired routes and settings. Reviewed-on: AquaPortal/s2s#3
This commit is contained in:
@@ -19,7 +19,6 @@ from fastapi.testclient import TestClient
|
||||
with patch.dict(os.environ, {}, clear=True), patch("dotenv.load_dotenv", return_value=False):
|
||||
from vocero_api import main as server
|
||||
from vocero_api.core import config as settings
|
||||
from vocero_api.providers import apipilot
|
||||
from vocero_api.realtime import proxy
|
||||
from vocero_api.services import context
|
||||
|
||||
@@ -42,21 +41,10 @@ BASE_CONFIG = {
|
||||
"S2S_LOGIN_BY_PHONE": "",
|
||||
"S2S_LATEST_SUMMARY": "",
|
||||
"S2S_LATEST_SUMMARY_TEXT": "",
|
||||
"S2S_APIPILOT_TOOLS_URL": "",
|
||||
"S2S_APIPILOT_TOOLS_EXECUTE_URL": "",
|
||||
"S2S_APIPILOT_SERVICE_TOKEN": "",
|
||||
"S2S_APIPILOT_API_KEY": "",
|
||||
"OPENAI_API_KEY": "",
|
||||
"S2S_REPORTS_QUICK_HINT_MAX": 5,
|
||||
"S2S_REPORTS_INJECT_MODE": "minimal",
|
||||
}
|
||||
TOOL = {
|
||||
"name": "fixture_tool",
|
||||
"description": "A fixture tool.",
|
||||
"parameters": {"type": "object", "properties": {"count": {"type": "integer"}}, "required": ["count"]},
|
||||
"requires_auth": False,
|
||||
"future_definition_field": {"nested": True},
|
||||
}
|
||||
|
||||
|
||||
def cases():
|
||||
@@ -268,7 +256,7 @@ def cases():
|
||||
for name, payload in (("missing", {}), ("proxy", {"transcript": "hello"}), ("proxy-blank", {"transcript": " "})):
|
||||
yield f"reasoning-{name}", "POST", "/api/reasoning", {"json": payload}, {}, []
|
||||
yield (
|
||||
"reasoning-OPENAI-legacy-unbound-token",
|
||||
"reasoning-openai-profile-disabled",
|
||||
"POST",
|
||||
"/api/reasoning",
|
||||
{"json": {"transcript": "hello"}},
|
||||
@@ -323,91 +311,6 @@ def cases():
|
||||
],
|
||||
)
|
||||
|
||||
for method, path, kwargs in (
|
||||
("GET", "/api/apipilot/tools", {}),
|
||||
("POST", "/api/apipilot/execute", {"json": {"name": "fixture_tool"}}),
|
||||
):
|
||||
yield f"apipilot-disabled-{method}", method, path, kwargs, {}, []
|
||||
tool_config = {"S2S_APIPILOT_TOOLS_URL": "http://tools.test/apipilot"}
|
||||
yield "tools-query-validation", "GET", "/api/apipilot/tools?refresh=invalid", {}, tool_config, []
|
||||
for name, payload in (
|
||||
("list", [TOOL]),
|
||||
("result", {"result": [TOOL]}),
|
||||
("envelope", {"data": {"tools": [TOOL]}, "future": True}),
|
||||
("opaque", "anything"),
|
||||
):
|
||||
yield (
|
||||
f"tools-{name}",
|
||||
"GET",
|
||||
"/api/apipilot/tools?include_unauthorized=false&refresh=true",
|
||||
{"headers": {"Authorization": "Bearer fixture-token", "x-demo-session": "fixture-session"}},
|
||||
tool_config,
|
||||
[(200, payload)],
|
||||
)
|
||||
yield "tools-upstream-error", "GET", "/api/apipilot/tools", {}, tool_config, [(403, {"error": "fixture"})]
|
||||
yield (
|
||||
"execute-discovery-error-envelope",
|
||||
"POST",
|
||||
"/api/apipilot/execute",
|
||||
{"json": {"name": "fixture_tool"}},
|
||||
tool_config,
|
||||
[(503, {})],
|
||||
)
|
||||
yield (
|
||||
"execute-unknown-tool",
|
||||
"POST",
|
||||
"/api/apipilot/execute",
|
||||
{"json": {"name": "unknown"}},
|
||||
tool_config,
|
||||
[(200, [TOOL]), (200, [TOOL])],
|
||||
)
|
||||
yield (
|
||||
"execute-missing-argument",
|
||||
"POST",
|
||||
"/api/apipilot/execute",
|
||||
{"json": {"name": "fixture_tool"}},
|
||||
tool_config,
|
||||
[(200, [TOOL])],
|
||||
)
|
||||
yield (
|
||||
"execute-api-key-precheck",
|
||||
"POST",
|
||||
"/api/apipilot/execute",
|
||||
{"json": {"name": "fixture_tool", "arguments": {"count": 1}}},
|
||||
{
|
||||
**tool_config,
|
||||
"S2S_APIPILOT_API_KEY": "fixture-key",
|
||||
},
|
||||
[(200, [{**TOOL, "requires_auth": True}])],
|
||||
)
|
||||
for name, payload in (
|
||||
("envelope", {"success": True, "data": {"future": [1, None]}, "error": None, "future_envelope": True}),
|
||||
("raw-list", [{"future": True}]),
|
||||
("minimal-envelope", {"success": True}),
|
||||
(
|
||||
"error",
|
||||
{
|
||||
"success": False,
|
||||
"data": None,
|
||||
"error": {"status_code": 409, "code": "FIXTURE", "message": "Fixture", "future": True},
|
||||
},
|
||||
),
|
||||
):
|
||||
yield (
|
||||
f"execute-{name}",
|
||||
"POST",
|
||||
"/api/apipilot/execute",
|
||||
{
|
||||
"json": {
|
||||
"name": "fixture_tool",
|
||||
"arguments": {"count": "wrong-type-is-accepted", "unknown": 1},
|
||||
"future": True,
|
||||
}
|
||||
},
|
||||
tool_config,
|
||||
[(200, [TOOL]), (200, payload)],
|
||||
)
|
||||
|
||||
|
||||
def capture_http():
|
||||
captures = {}
|
||||
@@ -442,7 +345,6 @@ def capture_http():
|
||||
|
||||
with (
|
||||
patch.multiple(settings, **{**BASE_CONFIG, **config}),
|
||||
patch.object(apipilot, "_APIPILOT_CACHE", {}),
|
||||
patch.object(context, "_build_today_fixed_context_block", return_value="Fixture current date: 2026-01-04"),
|
||||
patch.object(
|
||||
httpx,
|
||||
@@ -482,7 +384,6 @@ def capture_openapi_requests():
|
||||
for name in (
|
||||
"SearchRequest",
|
||||
"ReasoningRequest",
|
||||
"ApipilotExecuteRequest",
|
||||
"HTTPValidationError",
|
||||
"ValidationError",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user