mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 14:10:24 +00:00
fix(cron): do not misclassify empty/NO_REPLY as interim acknowledgement (#41401)
* fix(cron): do not misclassify empty/NO_REPLY as interim acknowledgement
When a cron task's agent returns NO_REPLY, the payload filter strips the
silent token, leaving an empty text string. isLikelyInterimCronMessage()
previously returned true for empty input, causing the cron runner to
inject a forced rerun prompt ('Your previous response was only an
acknowledgement...').
Change the empty-string branch to return false: empty text after payload
filtering means the agent deliberately chose silent completion, not that
it sent an interim 'on it' message.
Fixes #41246
* fix(cron): do not misclassify empty/NO_REPLY as interim acknowledgement
Fixes #41246. (#41383) thanks @jackal092927.
---------
Co-authored-by: xaeon2026 <xaeon2026@gmail.com>
This commit is contained in:
@@ -47,8 +47,12 @@ describe("isLikelyInterimCronMessage", () => {
|
||||
false,
|
||||
);
|
||||
});
|
||||
it("treats empty as interim", () => {
|
||||
expect(isLikelyInterimCronMessage("")).toBe(true);
|
||||
it("does not treat empty as interim (empty = NO_REPLY was stripped)", () => {
|
||||
expect(isLikelyInterimCronMessage("")).toBe(false);
|
||||
});
|
||||
|
||||
it("does not treat whitespace-only as interim", () => {
|
||||
expect(isLikelyInterimCronMessage(" ")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -42,7 +42,10 @@ function normalizeHintText(value: string): string {
|
||||
export function isLikelyInterimCronMessage(value: string): boolean {
|
||||
const normalized = normalizeHintText(value);
|
||||
if (!normalized) {
|
||||
return true;
|
||||
// Empty text after payload filtering means the agent either returned
|
||||
// NO_REPLY (deliberately silent) or produced no deliverable content.
|
||||
// Do not treat this as an interim acknowledgement that needs a rerun.
|
||||
return false;
|
||||
}
|
||||
const words = normalized.split(" ").filter(Boolean).length;
|
||||
return words <= 45 && INTERIM_CRON_HINTS.some((hint) => normalized.includes(hint));
|
||||
|
||||
Reference in New Issue
Block a user