fix: align discussion workspace and tool schemas

This commit is contained in:
zhi
2026-04-02 11:52:20 +00:00
parent 7bccb660df
commit 895cfe3bab
8 changed files with 88 additions and 10 deletions

View File

@@ -21,6 +21,7 @@ type BeforeModelResolveDeps = {
sessionAllowed: Map<string, boolean>;
sessionChannelId: Map<string, string>;
sessionAccountId: Map<string, string>;
recordDiscussionSession?: (channelId: string, sessionKey: string) => void;
forceNoReplySessions: Set<string>;
policyState: { channelPolicies: Record<string, unknown> };
DECISION_TTL_MS: number;
@@ -43,6 +44,7 @@ export function registerBeforeModelResolveHook(deps: BeforeModelResolveDeps): vo
sessionAllowed,
sessionChannelId,
sessionAccountId,
recordDiscussionSession,
forceNoReplySessions,
policyState,
DECISION_TTL_MS,
@@ -92,6 +94,7 @@ export function registerBeforeModelResolveHook(deps: BeforeModelResolveDeps): vo
if (derived.channelId) {
sessionChannelId.set(key, derived.channelId);
recordDiscussionSession?.(derived.channelId, key);
if (discussionService?.isClosedDiscussion(derived.channelId)) {
sessionAllowed.set(key, false);
api.logger.info(`dirigent: before_model_resolve forcing no-reply for closed discussion channel=${derived.channelId} session=${key}`);