mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-26 18:35:38 +08:00
fix(ci): align SDK dependency and validate acceptance migrations
This commit is contained in:
@@ -192,7 +192,10 @@ class PersistentStateStore:
|
||||
if self._check_scope_enabled('conversation', binding) and event.conversation_id:
|
||||
if 'external.conversation_id' not in snapshot['conversation']:
|
||||
from .context_reset import get_reset_generation
|
||||
generation = await get_reset_generation(self._db_engine, event.workspace_id, event.bot_id, event.conversation_id)
|
||||
|
||||
generation = await get_reset_generation(
|
||||
self._db_engine, event.workspace_id, event.bot_id, event.conversation_id
|
||||
)
|
||||
snapshot['conversation']['external.conversation_id'] = generation or event.conversation_id
|
||||
|
||||
return snapshot
|
||||
|
||||
@@ -742,6 +742,7 @@ async def execute_platform_tool(
|
||||
raise ValueError(f'Platform API {definition.api} is no longer supported by bot {bot_id}')
|
||||
api_func = getattr(bot.adapter, definition.api, None)
|
||||
if reply_via_source:
|
||||
|
||||
async def api_func(target_type, target_id, message):
|
||||
source = await bot.adapter.get_message(
|
||||
chat_type=target_type,
|
||||
@@ -749,14 +750,17 @@ async def execute_platform_tool(
|
||||
message_id=delivery['reply_target']['message_id'],
|
||||
)
|
||||
return await bot.adapter.reply_message(source, message)
|
||||
|
||||
# Some platforms require a one-time event credential instead of an
|
||||
# ordinary conversation send. Only pass the Host-frozen event context.
|
||||
event_reply_handler = getattr(bot.adapter, 'reply_to_event', None)
|
||||
if definition.name == 'event_reply' and callable(event_reply_handler):
|
||||
|
||||
async def api_func(target_type, target_id, message):
|
||||
return await event_reply_handler(
|
||||
context=context, target_type=target_type, target_id=target_id, message=message
|
||||
)
|
||||
|
||||
if not callable(api_func):
|
||||
raise ValueError(f'Platform API {definition.api} is declared but not implemented')
|
||||
if definition.api == 'send_message':
|
||||
|
||||
@@ -336,6 +336,7 @@ class TranscriptStore:
|
||||
strict_thread: bool,
|
||||
) -> typing.Any:
|
||||
from .context_reset import active_history_condition
|
||||
|
||||
query = query.where(active_history_condition(Transcript))
|
||||
if bot_id is not None:
|
||||
query = query.where(Transcript.bot_id == bot_id)
|
||||
|
||||
Reference in New Issue
Block a user