fix(ai): enforce cross-chat execution budgets

Count complete tool payloads with the runtime tokenizer so Chinese evidence respects the configured model context budget.\n\nResolve contact sources incrementally with cancellation checks and targeted member lookups to keep long cross-chat investigations responsive.
This commit is contained in:
digua committed 2026-08-22 17:09:23 +08:00
1 parent 5d5355d4f1
commit dc3bd82c90
11 files changed
+162 -21

No files matched your search

+2 -1
View File
@@ -4,7 +4,7 @@ import type {
PreprocessConfig,
SessionRuntimeAdapter,
} from '@openchatlab/node-runtime'
import { preprocessCrossChatMessages } from '@openchatlab/node-runtime'
import { countTokens, preprocessCrossChatMessages } from '@openchatlab/node-runtime'
import {
CROSS_CHAT_AGENT_TOOL_REGISTRY,
executeToolForAgent,
@@ -23,6 +23,7 @@ export function createCliCrossChatTools(options: {
locale: options.locale,
analysisService: options.analysisService,
maxToolResultTokens: options.maxToolResultTokens,
countTokens,
preprocessMessagesBySession: (sessionId, messages) =>
preprocessCrossChatMessages(
options.sessionAdapter,