fix(feishu): restore assistant creation and pairing recovery

Refs NAN-239
This commit is contained in:
Xubin Ren committed 2026-10-12 17:38:43 +08:00
1 parent cfb0f51e78
commit 2aa98677c6
36 files changed
+369 -47

No files matched your search

+16
View File
@@ -13,12 +13,28 @@ from nanobot.config.loader import load_config, save_config
from nanobot.config.schema import Config
from nanobot.webui.settings_system import (
coerce_channel_value,
pairing_payload,
save_channel_config_values,
system_settings_payload,
update_agent_system_settings,
)
@pytest.mark.parametrize("status", [None, "sending", "sent", "failed", "unknown", []])
def test_pairing_payload_preserves_optional_delivery_state(status):
item = {"code": "ABCD-EFGH", "channel": "feishu", "sender_id": "alice",
"created_at": 1000, "expires_at": 1600}
if status is not None:
item["delivery_status"] = status
[request] = pairing_payload(lambda: [item], now=1100)["requests"]
assert request["code"] == "ABCD-EFGH"
assert request["expires_in_seconds"] == 500
if isinstance(status, str) and status in {"sending", "sent", "failed"}:
assert request["delivery_status"] == status
else:
assert "delivery_status" not in request
def test_system_domain_owns_runtime_dto_and_agent_updates(tmp_path, monkeypatch) -> None:
monkeypatch.setattr("nanobot.webui.settings_system.COMMIT", "a" * 40)
config = Config()