@@ -11,6 +11,8 @@ import {
1111} from "openclaw/plugin-sdk/command-primitives-runtime" ;
1212import { resolveTelegramForumThreadId } from "./bot/helpers.js" ;
1313
14+ const TELEGRAM_NON_READ_ONLY_STATUS_COMMAND_KEYS = new Set ( [ "export-session" , "export-trajectory" ] ) ;
15+
1416type TelegramSequentialKeyContext = {
1517 chat ?: { id ?: number } ;
1618 me ?: UserFromGetMe ;
@@ -32,9 +34,8 @@ export function isTelegramReadOnlyControlLaneText(params: {
3234 rawText ?: string ;
3335 botUsername ?: string ;
3436} ) : boolean {
35- // Only read-only status commands should bypass the per-topic lane. Commands
36- // like /export-session stay on the normal lane because they materialize
37- // session state to disk and should not interleave with an active turn.
37+ // Only read-only status commands should bypass the per-topic lane. Export
38+ // commands materialize mutable session state and should not interleave with an active turn.
3839 const normalizedBody = normalizeCommandBody (
3940 params . rawText ?. trim ( ) ?? "" ,
4041 params . botUsername ? { botUsername : params . botUsername } : undefined ,
@@ -46,7 +47,9 @@ export function isTelegramReadOnlyControlLaneText(params: {
4647 const command = listChatCommands ( ) . find ( ( entry ) =>
4748 entry . textAliases . some ( ( candidate ) => candidate . trim ( ) . toLowerCase ( ) === alias ) ,
4849 ) ;
49- return command ?. category === "status" && command . key !== "export-session" ;
50+ return (
51+ command ?. category === "status" && ! TELEGRAM_NON_READ_ONLY_STATUS_COMMAND_KEYS . has ( command . key )
52+ ) ;
5053}
5154
5255function isTelegramTargetedStopCommand ( rawText ?: string , botUsername ?: string ) : boolean {
0 commit comments