chore(WeiXin): version migration and compatibility update

This commit is contained in:
xcosmosbox 2026-03-24 14:57:51 +08:00 committed by Xubin Ren
parent 48902ae95a
commit 0dad6124a2
2 changed files with 7 additions and 1 deletions

View File

@ -53,7 +53,8 @@ MESSAGE_TYPE_BOT = 2
MESSAGE_STATE_FINISH = 2
WEIXIN_MAX_MESSAGE_LEN = 4000
BASE_INFO: dict[str, str] = {"channel_version": "1.0.2"}
WEIXIN_CHANNEL_VERSION = "1.0.3"
BASE_INFO: dict[str, str] = {"channel_version": WEIXIN_CHANNEL_VERSION}
# Session-expired error code
ERRCODE_SESSION_EXPIRED = -14

View File

@ -11,6 +11,7 @@ from nanobot.channels.weixin import (
ITEM_IMAGE,
ITEM_TEXT,
MESSAGE_TYPE_BOT,
WEIXIN_CHANNEL_VERSION,
WeixinChannel,
WeixinConfig,
)
@ -43,6 +44,10 @@ def test_make_headers_includes_route_tag_when_configured() -> None:
assert headers["SKRouteTag"] == "123"
def test_channel_version_matches_reference_plugin_version() -> None:
assert WEIXIN_CHANNEL_VERSION == "1.0.3"
def test_save_and_load_state_persists_context_tokens(tmp_path) -> None:
bus = MessageBus()
channel = WeixinChannel(