feat(csm): bootstrap discussion callback flow
This commit is contained in:
@@ -21,6 +21,7 @@ type BeforeModelResolveDeps = {
|
||||
sessionAllowed: Map<string, boolean>;
|
||||
sessionChannelId: Map<string, string>;
|
||||
sessionAccountId: Map<string, string>;
|
||||
forceNoReplySessions: Set<string>;
|
||||
policyState: { channelPolicies: Record<string, unknown> };
|
||||
DECISION_TTL_MS: number;
|
||||
ensurePolicyStateLoaded: (api: OpenClawPluginApi, config: DirigentConfig) => void;
|
||||
@@ -38,6 +39,7 @@ export function registerBeforeModelResolveHook(deps: BeforeModelResolveDeps): vo
|
||||
sessionAllowed,
|
||||
sessionChannelId,
|
||||
sessionAccountId,
|
||||
forceNoReplySessions,
|
||||
policyState,
|
||||
DECISION_TTL_MS,
|
||||
ensurePolicyStateLoaded,
|
||||
@@ -54,6 +56,14 @@ export function registerBeforeModelResolveHook(deps: BeforeModelResolveDeps): vo
|
||||
const live = baseConfig as DirigentConfig & DebugConfig;
|
||||
ensurePolicyStateLoaded(api, live);
|
||||
|
||||
if (forceNoReplySessions.has(key)) {
|
||||
return {
|
||||
model: ctx.model,
|
||||
provider: ctx.provider,
|
||||
noReply: true,
|
||||
};
|
||||
}
|
||||
|
||||
const prompt = ((event as Record<string, unknown>).prompt as string) || "";
|
||||
|
||||
if (live.enableDebugLogs) {
|
||||
|
||||
Reference in New Issue
Block a user