mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 08:50:21 +00:00
fix(routing): unify session delivery invariants for duplicate suppression (#33786)
* Routing: unify session delivery invariants * Routing: address PR review feedback * Routing: tighten topic and session-scope suppression * fix(chat): inherit routes for per-account channel-peer sessions
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
export function extractToolSend(
|
||||
args: Record<string, unknown>,
|
||||
expectedAction = "sendMessage",
|
||||
): { to: string; accountId?: string } | null {
|
||||
): { to: string; accountId?: string; threadId?: string } | null {
|
||||
const action = typeof args.action === "string" ? args.action.trim() : "";
|
||||
if (action !== expectedAction) {
|
||||
return null;
|
||||
@@ -11,5 +11,12 @@ export function extractToolSend(
|
||||
return null;
|
||||
}
|
||||
const accountId = typeof args.accountId === "string" ? args.accountId.trim() : undefined;
|
||||
return { to, accountId };
|
||||
const threadIdRaw =
|
||||
typeof args.threadId === "string"
|
||||
? args.threadId.trim()
|
||||
: typeof args.threadId === "number"
|
||||
? String(args.threadId)
|
||||
: "";
|
||||
const threadId = threadIdRaw.length > 0 ? threadIdRaw : undefined;
|
||||
return { to, accountId, threadId };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user