mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-01 23:27:14 +00:00
feat(health): expose plugin runtime readiness (#2420)
Co-authored-by: Chan <dadachann@users.noreply.github.com>
This commit is contained in:
@@ -249,6 +249,10 @@ class Application:
|
|||||||
{},
|
{},
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
'plugin_runtime_connected': bool(
|
||||||
|
self.plugin_connector is not None
|
||||||
|
and getattr(self.plugin_connector, '_runtime_available', lambda: False)()
|
||||||
|
),
|
||||||
}
|
}
|
||||||
mcp_loader = getattr(self.tool_mgr, 'mcp_tool_loader', None)
|
mcp_loader = getattr(self.tool_mgr, 'mcp_tool_loader', None)
|
||||||
runtime_stats.update(
|
runtime_stats.update(
|
||||||
|
|||||||
@@ -87,7 +87,10 @@ async def test_runtime_resource_stats_are_aggregate_and_constant_time() -> None:
|
|||||||
app.platform_mgr = SimpleNamespace(_bots_by_key={})
|
app.platform_mgr = SimpleNamespace(_bots_by_key={})
|
||||||
app.pipeline_mgr = SimpleNamespace(_pipelines_by_key={})
|
app.pipeline_mgr = SimpleNamespace(_pipelines_by_key={})
|
||||||
app.rag_mgr = SimpleNamespace(knowledge_bases={})
|
app.rag_mgr = SimpleNamespace(knowledge_bases={})
|
||||||
app.plugin_connector = SimpleNamespace(_known_desired_states={'installation': object()})
|
app.plugin_connector = SimpleNamespace(
|
||||||
|
_known_desired_states={'installation': object()},
|
||||||
|
_runtime_available=lambda: True,
|
||||||
|
)
|
||||||
app.persistence_mgr = SimpleNamespace(
|
app.persistence_mgr = SimpleNamespace(
|
||||||
get_resource_stats=lambda: {
|
get_resource_stats=lambda: {
|
||||||
'configured_capacity': 20,
|
'configured_capacity': 20,
|
||||||
@@ -140,3 +143,4 @@ async def test_runtime_resource_stats_are_aggregate_and_constant_time() -> None:
|
|||||||
}
|
}
|
||||||
assert stats['models']['providers'] == 1
|
assert stats['models']['providers'] == 1
|
||||||
assert stats['runtimes']['plugin_installations'] == 1
|
assert stats['runtimes']['plugin_installations'] == 1
|
||||||
|
assert stats['runtimes']['plugin_runtime_connected'] is True
|
||||||
|
|||||||
Reference in New Issue
Block a user