mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-22 00:15:20 +08:00
fix(telemetry): avoid global plugin enumeration in workspace snapshots and support model adapters
This commit is contained in:
@@ -189,10 +189,10 @@ async def build_heartbeat_payload(
|
||||
cloud_counter=lambda: len(ap.platform_mgr._bots_by_key),
|
||||
)
|
||||
|
||||
# Plugin count (from plugin runtime)
|
||||
# Scoped Cloud counts are already available; never issue tenantless RPCs.
|
||||
try:
|
||||
plugin_connector = getattr(ap, 'plugin_connector', None)
|
||||
if plugin_connector is not None:
|
||||
if workspace_resource is None and plugin_connector is not None:
|
||||
plugins = await plugin_connector.list_plugins()
|
||||
features['plugin_count'] = len(plugins)
|
||||
except Exception:
|
||||
|
||||
@@ -117,5 +117,7 @@ def observe_adapter(ap, context, adapter):
|
||||
|
||||
return wrapped
|
||||
|
||||
setattr(adapter, name, make_wrapper(original, name))
|
||||
setattr(adapter, '_execution_observed', True)
|
||||
# Adapters are Pydantic models: method instrumentation is not a model
|
||||
# field assignment. Keep wrappers instance-local, never on the class.
|
||||
object.__setattr__(adapter, name, make_wrapper(original, name))
|
||||
object.__setattr__(adapter, '_execution_observed', True)
|
||||
|
||||
Reference in New Issue
Block a user