feat(turn-init): use internal Discord channel member resolver for bootstrap (no public tool)

This commit is contained in:
2026-03-08 06:08:51 +00:00
parent 121786e6e3
commit 307235e207
5 changed files with 162 additions and 11 deletions

View File

@@ -28,7 +28,7 @@ type BeforeModelResolveDeps = {
resolveAccountId: (api: OpenClawPluginApi, agentId: string) => string | undefined;
pruneDecisionMap: () => void;
shouldDebugLog: (config: DirigentConfig & DebugConfig, channelId?: string) => boolean;
ensureTurnOrder: (api: OpenClawPluginApi, channelId: string) => void;
ensureTurnOrder: (api: OpenClawPluginApi, channelId: string) => Promise<void> | void;
};
export function registerBeforeModelResolveHook(deps: BeforeModelResolveDeps): void {
@@ -111,7 +111,7 @@ export function registerBeforeModelResolveHook(deps: BeforeModelResolveDeps): vo
}
if (derived.channelId) {
ensureTurnOrder(api, derived.channelId);
await ensureTurnOrder(api, derived.channelId);
const accountId = resolveAccountId(api, ctx.agentId || "");
if (accountId) {
const turnCheck = checkTurn(derived.channelId, accountId);