mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-19 16:12:30 +00:00
Extract duplicated bus/provider/loop initialization from CLI commands (serve, _run_gateway, agent) and Nanobot facade into a single AgentLoop.from_config() classmethod. - Remove _make_provider() from cli/commands.py and nanobot.py - Remove inline provider creation in all three CLI entry points - AgentLoop.from_config() creates MessageBus, calls make_provider(), and assembles AgentLoop with all standard config-derived parameters - Supports **extra overrides for callers that need custom args (e.g. cron_service, session_manager, provider_snapshot_loader) - Update tests to mock make_provider at nanobot.providers.factory and add from_config classmethod to _FakeAgentLoop fixtures This is PR 1/4 of the model-preset feature decomposition.