mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:10:43 +00:00
fix: clear replay lint regressions
This commit is contained in:
@@ -1243,8 +1243,7 @@ describe("sanitizeSessionHistory", () => {
|
||||
message &&
|
||||
typeof message === "object" &&
|
||||
message.role === "assistant" &&
|
||||
extractToolCallsFromAssistant(message as Extract<AgentMessage, { role: "assistant" }>)
|
||||
.length > 0,
|
||||
extractToolCallsFromAssistant(message).length > 0,
|
||||
),
|
||||
).toHaveLength(1);
|
||||
expect(
|
||||
@@ -1258,8 +1257,7 @@ describe("sanitizeSessionHistory", () => {
|
||||
message &&
|
||||
typeof message === "object" &&
|
||||
message.role === "assistant" &&
|
||||
extractToolCallsFromAssistant(message as Extract<AgentMessage, { role: "assistant" }>)
|
||||
.length > 0,
|
||||
extractToolCallsFromAssistant(message).length > 0,
|
||||
),
|
||||
).toHaveLength(1);
|
||||
expect(
|
||||
|
||||
@@ -354,9 +354,7 @@ function sanitizeReplayToolCallInputs(
|
||||
message.content.some((block) => isThinkingLikeReplayBlock(block)) &&
|
||||
message.content.some((block) => isReplayToolCallBlock(block))
|
||||
) {
|
||||
const replaySafeToolCalls = extractToolCallsFromAssistant(
|
||||
message as Extract<AgentMessage, { role: "assistant" }>,
|
||||
);
|
||||
const replaySafeToolCalls = extractToolCallsFromAssistant(message);
|
||||
if (
|
||||
isReplaySafeThinkingTurn(message.content, allowedToolNames) &&
|
||||
replaySafeToolCalls.every((toolCall) => !claimedReplaySafeToolCallIds.has(toolCall.id))
|
||||
@@ -720,8 +718,7 @@ export function wrapStreamFnSanitizeMalformedToolCalls(
|
||||
: sanitized.messages;
|
||||
if (transcriptPolicy?.validateAnthropicTurns) {
|
||||
nextMessages = sanitizeAnthropicReplayToolResults(nextMessages, {
|
||||
disallowEmbeddedUserToolResultsForSignedThinkingReplay:
|
||||
allowProviderOwnedThinkingReplay,
|
||||
disallowEmbeddedUserToolResultsForSignedThinkingReplay: allowProviderOwnedThinkingReplay,
|
||||
});
|
||||
}
|
||||
if (nextMessages === messages) {
|
||||
|
||||
@@ -142,7 +142,7 @@ export function isRedactedSessionsSpawnAttachment(item: unknown): boolean {
|
||||
if (!(SESSIONS_SPAWN_ATTACHMENT_METADATA_KEYS as readonly string[]).includes(key)) {
|
||||
return false;
|
||||
}
|
||||
if (typeof attachment[key] !== "string" || (attachment[key] as string).trim().length === 0) {
|
||||
if (typeof attachment[key] !== "string" || attachment[key].trim().length === 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user