Infra: unify plugin split runtime state (#50725)

Merged via squash.

Prepared head SHA: 570b7b9459
Co-authored-by: huntharo <5617868+huntharo@users.noreply.github.com>
Co-authored-by: huntharo <5617868+huntharo@users.noreply.github.com>
Reviewed-by: @huntharo
This commit is contained in:
Harold Hunt
2026-03-21 11:00:21 -04:00
committed by GitHub
parent 1643d15057
commit 5eb99a9b50
13 changed files with 406 additions and 56 deletions

View File

@@ -6,6 +6,7 @@ import {
resolveThreadBindingConversationIdFromBindingId,
unregisterSessionBindingAdapter,
type BindingTargetKind,
type SessionBindingAdapter,
type SessionBindingRecord,
} from "openclaw/plugin-sdk/conversation-runtime";
import { normalizeAccountId, resolveAgentIdFromSessionKey } from "openclaw/plugin-sdk/routing";
@@ -233,11 +234,15 @@ export function createFeishuThreadBindingManager(params: {
}
}
getState().managersByAccountId.delete(accountId);
unregisterSessionBindingAdapter({ channel: "feishu", accountId });
unregisterSessionBindingAdapter({
channel: "feishu",
accountId,
adapter: sessionBindingAdapter,
});
},
};
registerSessionBindingAdapter({
const sessionBindingAdapter: SessionBindingAdapter = {
channel: "feishu",
accountId,
capabilities: {
@@ -292,7 +297,9 @@ export function createFeishuThreadBindingManager(params: {
const removed = manager.unbindConversation(conversationId);
return removed ? [toSessionBindingRecord(removed, { idleTimeoutMs, maxAgeMs })] : [];
},
});
};
registerSessionBindingAdapter(sessionBindingAdapter);
getState().managersByAccountId.set(accountId, manager);
return manager;