fix(cron): tolerate malformed legacy jobs#71509
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
🔒 Aisle Security AnalysisWe found 1 potential security issue(s) in this PR:
1. 🟡 Terminal escape (ANSI/OSC) injection in cron CLI output
Description
Because cron jobs are loaded from Vulnerable flow:
Vulnerable code (selected): const idLabel = pad(job.id, CRON_ID_PAD);
const nameLabel = pad(truncate(stringifyCell(job.name), CRON_NAME_PAD), CRON_NAME_PAD);
const targetLabel = pad(job.sessionTarget ?? "-", CRON_TARGET_PAD);
...
const line = [
colorize(rich, theme.accent, idLabel),
colorize(rich, theme.info, nameLabel),
...
].join(" ");
runtime.log(line.trimEnd());Note: the new RecommendationNeutralize terminal control sequences before printing any untrusted values. A pragmatic approach is to strip ANSI escapes and other control characters from job-controlled fields (ID/name/target/agent/model/schedule/delivery) before padding/truncation. Example: import stripAnsi from "strip-ansi";
const stripControl = (s: string) =>
stripAnsi(s).replace(/[\u0000-\u001F\u007F-\u009F]/g, "");
const safeCell = (value: unknown, fallback = "-") => {
const s = stringifyCell(value, fallback);
return stripControl(s);
};
const pad = (value: unknown, width: number) => safeCell(value).padEnd(width);If you want to preserve colors in your own output, only sanitize untrusted fields (not static labels) and keep applying Analyzed PR: #71509 at commit Last updated on: 2026-04-25T09:39:56Z |
Greptile SummaryThis PR hardens the cron subsystem against malformed legacy jobs by: (1) initializing missing Confidence Score: 5/5Safe to merge — all changes are purely defensive null-guards with no behavioral changes for well-formed data. All three fix sites correctly handle the malformed cases while leaving the happy path unchanged. Regression tests cover each scenario (missing state, legacy payload.message, malformed CLI row). No security surface is widened and no data is mutated in an unsafe way. No files require special attention. Reviews (1): Last reviewed commit: "fix(cron): tolerate malformed legacy job..." | Re-trigger Greptile |
dabfe99 to
3eed107
Compare
… Unreleased Three of my (vincentkoc) entries were missing closing PR refs, and several maintainer-fix entries were missing credit for the user who reported the underlying issue: - Diagnostics/OTEL outbound delivery: add (#71471) and credit @jlapenna whose #70424 framed the broader tracing work. - Cron malformed legacy jobs: add (#71509). - OpenAI/Codex OAuth region failures: add (#71501) and credit reporter @wulala-xjj (#51175). - Telegram duplicate pollers: credit reporter @Co-Messi (#56230). - MCP/CLI one-shot retire: credit reporter @spartoviMD (#71457). - OpenAI/Codex image baseUrl canonicalize: credit reporter @GodsBoy (#71460). - Feishu TTS Ogg/Opus: credit reporters @sg1416-zg (#61249) and @ycjlb2023-peteryi (#37868). - MiniMax TTS portal OAuth: credit reporter @zx15210404690-hash (#55017). - MCP config reload disposal: credit reporter @xieyuanqing (#60656).
… Unreleased Three of my (vincentkoc) entries were missing closing PR refs, and several maintainer-fix entries were missing credit for the user who reported the underlying issue: - Diagnostics/OTEL outbound delivery: add (openclaw#71471) and credit @jlapenna whose openclaw#70424 framed the broader tracing work. - Cron malformed legacy jobs: add (openclaw#71509). - OpenAI/Codex OAuth region failures: add (openclaw#71501) and credit reporter @wulala-xjj (openclaw#51175). - Telegram duplicate pollers: credit reporter @Co-Messi (openclaw#56230). - MCP/CLI one-shot retire: credit reporter @spartoviMD (openclaw#71457). - OpenAI/Codex image baseUrl canonicalize: credit reporter @GodsBoy (openclaw#71460). - Feishu TTS Ogg/Opus: credit reporters @sg1416-zg (openclaw#61249) and @ycjlb2023-peteryi (openclaw#37868). - MiniMax TTS portal OAuth: credit reporter @zx15210404690-hash (openclaw#55017). - MCP config reload disposal: credit reporter @xieyuanqing (openclaw#60656).
… Unreleased Three of my (vincentkoc) entries were missing closing PR refs, and several maintainer-fix entries were missing credit for the user who reported the underlying issue: - Diagnostics/OTEL outbound delivery: add (openclaw#71471) and credit @jlapenna whose openclaw#70424 framed the broader tracing work. - Cron malformed legacy jobs: add (openclaw#71509). - OpenAI/Codex OAuth region failures: add (openclaw#71501) and credit reporter @wulala-xjj (openclaw#51175). - Telegram duplicate pollers: credit reporter @Co-Messi (openclaw#56230). - MCP/CLI one-shot retire: credit reporter @spartoviMD (openclaw#71457). - OpenAI/Codex image baseUrl canonicalize: credit reporter @GodsBoy (openclaw#71460). - Feishu TTS Ogg/Opus: credit reporters @sg1416-zg (openclaw#61249) and @ycjlb2023-peteryi (openclaw#37868). - MiniMax TTS portal OAuth: credit reporter @zx15210404690-hash (openclaw#55017). - MCP config reload disposal: credit reporter @xieyuanqing (openclaw#60656).
… Unreleased Three of my (vincentkoc) entries were missing closing PR refs, and several maintainer-fix entries were missing credit for the user who reported the underlying issue: - Diagnostics/OTEL outbound delivery: add (openclaw#71471) and credit @jlapenna whose openclaw#70424 framed the broader tracing work. - Cron malformed legacy jobs: add (openclaw#71509). - OpenAI/Codex OAuth region failures: add (openclaw#71501) and credit reporter @wulala-xjj (openclaw#51175). - Telegram duplicate pollers: credit reporter @Co-Messi (openclaw#56230). - MCP/CLI one-shot retire: credit reporter @spartoviMD (openclaw#71457). - OpenAI/Codex image baseUrl canonicalize: credit reporter @GodsBoy (openclaw#71460). - Feishu TTS Ogg/Opus: credit reporters @sg1416-zg (openclaw#61249) and @ycjlb2023-peteryi (openclaw#37868). - MiniMax TTS portal OAuth: credit reporter @zx15210404690-hash (openclaw#55017). - MCP config reload disposal: credit reporter @xieyuanqing (openclaw#60656).
… Unreleased Three of my (vincentkoc) entries were missing closing PR refs, and several maintainer-fix entries were missing credit for the user who reported the underlying issue: - Diagnostics/OTEL outbound delivery: add (openclaw#71471) and credit @jlapenna whose openclaw#70424 framed the broader tracing work. - Cron malformed legacy jobs: add (openclaw#71509). - OpenAI/Codex OAuth region failures: add (openclaw#71501) and credit reporter @wulala-xjj (openclaw#51175). - Telegram duplicate pollers: credit reporter @Co-Messi (openclaw#56230). - MCP/CLI one-shot retire: credit reporter @spartoviMD (openclaw#71457). - OpenAI/Codex image baseUrl canonicalize: credit reporter @GodsBoy (openclaw#71460). - Feishu TTS Ogg/Opus: credit reporters @sg1416-zg (openclaw#61249) and @ycjlb2023-peteryi (openclaw#37868). - MiniMax TTS portal OAuth: credit reporter @zx15210404690-hash (openclaw#55017). - MCP config reload disposal: credit reporter @xieyuanqing (openclaw#60656).
… Unreleased Three of my (vincentkoc) entries were missing closing PR refs, and several maintainer-fix entries were missing credit for the user who reported the underlying issue: - Diagnostics/OTEL outbound delivery: add (openclaw#71471) and credit @jlapenna whose openclaw#70424 framed the broader tracing work. - Cron malformed legacy jobs: add (openclaw#71509). - OpenAI/Codex OAuth region failures: add (openclaw#71501) and credit reporter @wulala-xjj (openclaw#51175). - Telegram duplicate pollers: credit reporter @Co-Messi (openclaw#56230). - MCP/CLI one-shot retire: credit reporter @spartoviMD (openclaw#71457). - OpenAI/Codex image baseUrl canonicalize: credit reporter @GodsBoy (openclaw#71460). - Feishu TTS Ogg/Opus: credit reporters @sg1416-zg (openclaw#61249) and @ycjlb2023-peteryi (openclaw#37868). - MiniMax TTS portal OAuth: credit reporter @zx15210404690-hash (openclaw#55017). - MCP config reload disposal: credit reporter @xieyuanqing (openclaw#60656).
Summary
statepayload.messageand missingpayload.textopenclaw cron listtolerate malformed rows instead of crashing on undefined display fieldsFixes #66016.
Fixes #65916.
Fixes #64137.
Fixes #57872.
Fixes #59968.
Fixes #63813.
Fixes #52804.
Fixes #43163.
Related to #44920.
Validation
pnpm test src/cli/cron-cli/shared.test.ts src/cron/service/ops.regression.test.ts src/cron/service.jobs.test.ts src/cron/service.restart-catchup.test.ts src/cron/store.test.ts src/cron/service/store.load-missing-session-target.test.tsOPENCLAW_LOCAL_CHECK=0 pnpm check:changed