mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:40:42 +00:00
refactor(agents): trim bootstrap marker gate
This commit is contained in:
@@ -8,7 +8,6 @@ describe("runEmbeddedAttempt bootstrap completion marker", () => {
|
||||
shouldRecordCompletedBootstrapTurn: true,
|
||||
promptError: undefined,
|
||||
aborted: false,
|
||||
yieldAborted: true,
|
||||
timedOutDuringCompaction: false,
|
||||
compactionOccurredThisAttempt: false,
|
||||
}),
|
||||
@@ -21,7 +20,6 @@ describe("runEmbeddedAttempt bootstrap completion marker", () => {
|
||||
shouldRecordCompletedBootstrapTurn: false,
|
||||
promptError: undefined,
|
||||
aborted: false,
|
||||
yieldAborted: false,
|
||||
timedOutDuringCompaction: false,
|
||||
compactionOccurredThisAttempt: false,
|
||||
}),
|
||||
@@ -34,7 +32,6 @@ describe("runEmbeddedAttempt bootstrap completion marker", () => {
|
||||
shouldRecordCompletedBootstrapTurn: true,
|
||||
promptError: undefined,
|
||||
aborted: true,
|
||||
yieldAborted: false,
|
||||
timedOutDuringCompaction: false,
|
||||
compactionOccurredThisAttempt: false,
|
||||
}),
|
||||
@@ -47,7 +44,6 @@ describe("runEmbeddedAttempt bootstrap completion marker", () => {
|
||||
shouldRecordCompletedBootstrapTurn: true,
|
||||
promptError: new Error("prompt failed"),
|
||||
aborted: false,
|
||||
yieldAborted: false,
|
||||
timedOutDuringCompaction: false,
|
||||
compactionOccurredThisAttempt: false,
|
||||
}),
|
||||
@@ -58,7 +54,6 @@ describe("runEmbeddedAttempt bootstrap completion marker", () => {
|
||||
shouldRecordCompletedBootstrapTurn: true,
|
||||
promptError: undefined,
|
||||
aborted: false,
|
||||
yieldAborted: false,
|
||||
timedOutDuringCompaction: true,
|
||||
compactionOccurredThisAttempt: false,
|
||||
}),
|
||||
@@ -69,7 +64,6 @@ describe("runEmbeddedAttempt bootstrap completion marker", () => {
|
||||
shouldRecordCompletedBootstrapTurn: true,
|
||||
promptError: undefined,
|
||||
aborted: false,
|
||||
yieldAborted: false,
|
||||
timedOutDuringCompaction: false,
|
||||
compactionOccurredThisAttempt: true,
|
||||
}),
|
||||
|
||||
@@ -93,7 +93,6 @@ export function shouldPersistCompletedBootstrapTurn(params: {
|
||||
shouldRecordCompletedBootstrapTurn: boolean;
|
||||
promptError: unknown;
|
||||
aborted: boolean;
|
||||
yieldAborted: boolean;
|
||||
timedOutDuringCompaction: boolean;
|
||||
compactionOccurredThisAttempt: boolean;
|
||||
}): boolean {
|
||||
@@ -103,7 +102,5 @@ export function shouldPersistCompletedBootstrapTurn(params: {
|
||||
if (params.timedOutDuringCompaction || params.compactionOccurredThisAttempt) {
|
||||
return false;
|
||||
}
|
||||
// Intentionally allow clean sessions_yield exits here so continuation-skip
|
||||
// can treat the next relay/user turn as an existing bootstrap session.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1946,9 +1946,6 @@ export async function runEmbeddedAttempt(
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
// Yield-triggered abort is intentional — treat as clean stop, not error.
|
||||
// Check the abort reason to distinguish from external aborts (timeout, user cancel)
|
||||
// that may race after yieldDetected is set.
|
||||
yieldAborted =
|
||||
yieldDetected &&
|
||||
isRunnerAbortError(err) &&
|
||||
@@ -1956,8 +1953,6 @@ export async function runEmbeddedAttempt(
|
||||
err.cause === "sessions_yield";
|
||||
if (yieldAborted) {
|
||||
aborted = false;
|
||||
// Ensure the session abort has mostly settled before proceeding, but
|
||||
// don't deadlock the whole run if the underlying session abort hangs.
|
||||
await waitForSessionsYieldAbortSettle({
|
||||
settlePromise: yieldAbortSettled,
|
||||
runId: params.runId,
|
||||
@@ -2174,7 +2169,6 @@ export async function runEmbeddedAttempt(
|
||||
shouldRecordCompletedBootstrapTurn,
|
||||
promptError,
|
||||
aborted,
|
||||
yieldAborted,
|
||||
timedOutDuringCompaction,
|
||||
compactionOccurredThisAttempt,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user