mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 17:10:20 +00:00
fix: restore ci after trim reader dedupe
This commit is contained in:
@@ -58,7 +58,7 @@ function resolveRawConfiguredAcpSessionKey(params: {
|
||||
parentConversationId?: string;
|
||||
}): string | undefined {
|
||||
for (const binding of acpResetTargetDeps.listAcpBindings(params.cfg)) {
|
||||
const bindingChannel = normalizeText(binding.match.channel)?.toLowerCase() ?? "";
|
||||
const bindingChannel = (normalizeOptionalString(binding.match.channel) ?? "").toLowerCase();
|
||||
if (!bindingChannel || bindingChannel !== params.channel) {
|
||||
continue;
|
||||
}
|
||||
@@ -107,13 +107,13 @@ export function resolveEffectiveResetTargetSessionKey(params: {
|
||||
skipConfiguredFallbackWhenActiveSessionNonAcp?: boolean;
|
||||
fallbackToActiveAcpWhenUnbound?: boolean;
|
||||
}): string | undefined {
|
||||
const activeSessionKey = normalizeOptionalString(params.activeSessionKey) ?? "";
|
||||
const activeSessionKey = normalizeOptionalString(params.activeSessionKey);
|
||||
const activeAcpSessionKey =
|
||||
activeSessionKey && isAcpSessionKey(activeSessionKey) ? activeSessionKey : undefined;
|
||||
const activeIsNonAcp = Boolean(activeSessionKey) && !activeAcpSessionKey;
|
||||
|
||||
const channel = normalizeText(params.channel)?.toLowerCase() ?? "";
|
||||
const conversationId = normalizeText(params.conversationId);
|
||||
const channel = (normalizeOptionalString(params.channel) ?? "").toLowerCase();
|
||||
const conversationId = normalizeOptionalString(params.conversationId) ?? "";
|
||||
if (!channel || !conversationId) {
|
||||
return activeAcpSessionKey;
|
||||
}
|
||||
|
||||
@@ -387,28 +387,29 @@ function applyOpenAIGptChatReplyGuard(params: {
|
||||
);
|
||||
|
||||
for (const payload of params.payloads) {
|
||||
const text = normalizeOptionalString(payload.text);
|
||||
if (
|
||||
!normalizeOptionalString(payload.text) ||
|
||||
!text ||
|
||||
payload.isError ||
|
||||
payload.isReasoning ||
|
||||
payload.mediaUrl ||
|
||||
(payload.mediaUrls?.length ?? 0) > 0 ||
|
||||
payload.interactive ||
|
||||
payload.text.includes("```")
|
||||
text.includes("```")
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isAckTurn) {
|
||||
payload.text = shortenChattyFinalReplyText(payload.text, {
|
||||
payload.text = shortenChattyFinalReplyText(text, {
|
||||
maxChars: GPT_CHAT_BREVITY_ACK_MAX_CHARS,
|
||||
maxSentences: GPT_CHAT_BREVITY_ACK_MAX_SENTENCES,
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
if (allowSoftCap && scoreChattyFinalReplyText(payload.text) >= 4) {
|
||||
payload.text = shortenChattyFinalReplyText(payload.text, {
|
||||
if (allowSoftCap && scoreChattyFinalReplyText(text) >= 4) {
|
||||
payload.text = shortenChattyFinalReplyText(text, {
|
||||
maxChars: GPT_CHAT_BREVITY_SOFT_MAX_CHARS,
|
||||
maxSentences: GPT_CHAT_BREVITY_SOFT_MAX_SENTENCES,
|
||||
});
|
||||
|
||||
@@ -413,8 +413,9 @@ export async function promptDefaultModel(
|
||||
const includeManual = params.includeManual ?? true;
|
||||
const includeProviderPluginSetups = params.includeProviderPluginSetups ?? false;
|
||||
const ignoreAllowlist = params.ignoreAllowlist ?? false;
|
||||
const preferredProvider = normalizeOptionalString(params.preferredProvider)
|
||||
? normalizeProviderId(params.preferredProvider)
|
||||
const preferredProviderRaw = normalizeOptionalString(params.preferredProvider);
|
||||
const preferredProvider = preferredProviderRaw
|
||||
? normalizeProviderId(preferredProviderRaw)
|
||||
: undefined;
|
||||
const configuredRaw = resolveConfiguredModelRaw(cfg);
|
||||
const resolved = resolveConfiguredModelRef({
|
||||
@@ -581,8 +582,9 @@ export async function promptModelAllowlist(params: {
|
||||
const existingKeys = resolveConfiguredModelKeys(cfg);
|
||||
const allowedKeys = normalizeModelKeys(params.allowedKeys ?? []);
|
||||
const allowedKeySet = allowedKeys.length > 0 ? new Set(allowedKeys) : null;
|
||||
const preferredProvider = normalizeOptionalString(params.preferredProvider)
|
||||
? normalizeProviderId(params.preferredProvider)
|
||||
const preferredProviderRaw = normalizeOptionalString(params.preferredProvider);
|
||||
const preferredProvider = preferredProviderRaw
|
||||
? normalizeProviderId(preferredProviderRaw)
|
||||
: undefined;
|
||||
const resolved = resolveConfiguredModelRef({
|
||||
cfg,
|
||||
|
||||
Reference in New Issue
Block a user