Use pluginConfig directly for Dirigent runtime config

This commit is contained in:
2026-04-01 19:33:00 +00:00
parent 0a76dae376
commit 0a99abc7e3
9 changed files with 59 additions and 151 deletions

View File

@@ -11,7 +11,6 @@ type DebugConfig = {
type MessageReceivedDeps = {
api: OpenClawPluginApi;
baseConfig: DirigentConfig;
getLivePluginConfig: (api: OpenClawPluginApi, fallback: DirigentConfig) => DirigentConfig;
shouldDebugLog: (config: DirigentConfig & DebugConfig, channelId?: string) => boolean;
debugCtxSummary: (ctx: Record<string, unknown>, event: Record<string, unknown>) => Record<string, unknown>;
ensureTurnOrder: (api: OpenClawPluginApi, channelId: string) => Promise<void> | void;
@@ -25,7 +24,6 @@ export function registerMessageReceivedHook(deps: MessageReceivedDeps): void {
const {
api,
baseConfig,
getLivePluginConfig,
shouldDebugLog,
debugCtxSummary,
ensureTurnOrder,
@@ -40,7 +38,7 @@ export function registerMessageReceivedHook(deps: MessageReceivedDeps): void {
const c = (ctx || {}) as Record<string, unknown>;
const e = (event || {}) as Record<string, unknown>;
const preChannelId = extractDiscordChannelId(c, e);
const livePre = getLivePluginConfig(api, baseConfig as DirigentConfig) as DirigentConfig & DebugConfig;
const livePre = baseConfig as DirigentConfig & DebugConfig;
if (shouldDebugLog(livePre, preChannelId)) {
api.logger.info(`dirigent: debug message_received preflight ctx=${JSON.stringify(debugCtxSummary(c, e))}`);
}