v0.1.4-p5
parent
fb461a7f5b
commit
4c99826863
|
|
@ -465,6 +465,10 @@ def serialize_bot_list_entry(bot: BotInstance) -> Dict[str, Any]:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _has_bot_workspace_config(bot_id: str) -> bool:
|
||||||
|
return (Path(BOTS_WORKSPACE_ROOT) / bot_id / ".nanobot" / "config.json").is_file()
|
||||||
|
|
||||||
|
|
||||||
def sync_bot_workspace_channels(
|
def sync_bot_workspace_channels(
|
||||||
session: Session,
|
session: Session,
|
||||||
bot_id: str,
|
bot_id: str,
|
||||||
|
|
@ -476,8 +480,14 @@ def sync_bot_workspace_channels(
|
||||||
if not bot:
|
if not bot:
|
||||||
raise RuntimeError(f"Bot not found: {bot_id}")
|
raise RuntimeError(f"Bot not found: {bot_id}")
|
||||||
|
|
||||||
snapshot = read_bot_runtime_snapshot(bot)
|
has_existing_config = _has_bot_workspace_config(bot_id)
|
||||||
bot_data: Dict[str, Any] = dict(snapshot)
|
if has_existing_config:
|
||||||
|
snapshot = read_bot_runtime_snapshot(bot)
|
||||||
|
bot_data: Dict[str, Any] = dict(snapshot)
|
||||||
|
else:
|
||||||
|
if not isinstance(runtime_overrides, dict):
|
||||||
|
raise RuntimeError(f"Missing required bot config for workspace sync: {bot_id}")
|
||||||
|
bot_data = {}
|
||||||
if isinstance(runtime_overrides, dict):
|
if isinstance(runtime_overrides, dict):
|
||||||
bot_data.update(runtime_overrides)
|
bot_data.update(runtime_overrides)
|
||||||
|
|
||||||
|
|
@ -495,7 +505,12 @@ def sync_bot_workspace_channels(
|
||||||
if "sendToolHints" in global_delivery_override:
|
if "sendToolHints" in global_delivery_override:
|
||||||
send_tool_hints = bool(global_delivery_override.get("sendToolHints"))
|
send_tool_hints = bool(global_delivery_override.get("sendToolHints"))
|
||||||
|
|
||||||
channels_data = channels_override if channels_override is not None else list_bot_channels_from_config(bot)
|
if channels_override is not None:
|
||||||
|
channels_data = channels_override
|
||||||
|
elif has_existing_config:
|
||||||
|
channels_data = list_bot_channels_from_config(bot)
|
||||||
|
else:
|
||||||
|
channels_data = []
|
||||||
bot_data["send_progress"] = send_progress
|
bot_data["send_progress"] = send_progress
|
||||||
bot_data["send_tool_hints"] = send_tool_hints
|
bot_data["send_tool_hints"] = send_tool_hints
|
||||||
normalized_channels: List[Dict[str, Any]] = []
|
normalized_channels: List[Dict[str, Any]] = []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue