refactor(agent): inject runtime model publisher

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Xubin Ren
2026-05-12 20:06:22 +08:00
committed by Xubin Ren
co-authored by Cursor
parent 6554c1f832
commit 13eede5803
6 changed files with 65 additions and 48 deletions
+6
View File
@@ -633,6 +633,7 @@ def _run_gateway(
from nanobot.agent.tools.message import MessageTool
from nanobot.bus.queue import MessageBus
from nanobot.channels.manager import ChannelManager
from nanobot.channels.websocket import publish_runtime_model_update
from nanobot.cron.service import CronService
from nanobot.cron.types import CronJob
from nanobot.heartbeat.service import HeartbeatService
@@ -672,6 +673,11 @@ def _run_gateway(
"aihubmix": config.providers.aihubmix,
},
provider_snapshot_loader=load_provider_snapshot,
runtime_model_publisher=lambda model, preset: publish_runtime_model_update(
bus,
model,
preset,
),
provider_signature=provider_snapshot.signature,
)