mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-19 20:34:46 +00:00
fix: reintroduce partial-fragment drop for clean timeouts
This commit is contained in:
@@ -2500,6 +2500,15 @@ export async function runEmbeddedPiAgent(
|
||||
});
|
||||
const timedOutDuringPrompt =
|
||||
timedOut && !timedOutDuringCompaction && !timedOutDuringToolExecution;
|
||||
const hasPartialAssistantTextAfterPromptTimeout =
|
||||
timedOutDuringPrompt &&
|
||||
(attempt.assistantTexts ?? []).some((text) => text.trim().length > 0) &&
|
||||
!attempt.clientToolCalls &&
|
||||
!attempt.yieldDetected &&
|
||||
!attempt.didSendViaMessagingTool &&
|
||||
!attempt.didSendDeterministicApprovalPrompt &&
|
||||
!attempt.lastToolError &&
|
||||
(attempt.toolMetas?.length ?? 0) === 0;
|
||||
const attemptToolSummary = buildTraceToolSummary({
|
||||
toolMetas: attempt.toolMetas,
|
||||
hadFailure: Boolean(attempt.lastToolError),
|
||||
@@ -2523,7 +2532,7 @@ export async function runEmbeddedPiAgent(
|
||||
"Please try again, or increase `agents.defaults.timeoutSeconds` in your config.";
|
||||
const replayInvalid = resolveReplayInvalidForAttempt(null);
|
||||
const livenessState = resolveRunLivenessState({
|
||||
payloadCount: payloads.length,
|
||||
payloadCount: hasPartialAssistantTextAfterPromptTimeout ? 0 : payloads.length,
|
||||
aborted,
|
||||
timedOut,
|
||||
attempt,
|
||||
@@ -2535,7 +2544,7 @@ export async function runEmbeddedPiAgent(
|
||||
});
|
||||
return {
|
||||
payloads: [
|
||||
...(payloadsWithToolMedia || []),
|
||||
...(hasPartialAssistantTextAfterPromptTimeout ? [] : (payloadsWithToolMedia || [])),
|
||||
{
|
||||
text: timeoutText,
|
||||
isError: true,
|
||||
|
||||
Reference in New Issue
Block a user