fix: clarify --tz help text to mention --at support (#59456)#59480
fix: clarify --tz help text to mention --at support (#59456)#59480lawrence3699 wants to merge 1 commit into
Conversation
Greptile SummaryThis PR updates the However, the PR also bundles unrelated changes to Key points:
Confidence Score: 4/5
Reviews (1): Last reviewed commit: "fix: clarify --tz help text to mention -..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
This PR updates CLI help text for the --tz option to clarify that it applies to both cron schedules and --at one-shot schedules, and also improves the memory_search tool’s “unavailable” payload to provide more actionable guidance when node:sqlite is missing.
Changes:
- Update
openclaw cron add/edit--tzhelp text to mention--atusage. - Classify missing
node:sqlitefailures inmemory_searchand return a targeted warning/action. - Add a unit test covering the new
node:sqlite-missing unavailable payload.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/cli/cron-cli/register.cron-add.ts | Adjusts --tz help text to mention --at schedules. |
| src/cli/cron-cli/register.cron-edit.ts | Adjusts --tz help text to mention --at schedules (and sits next to --at help). |
| extensions/memory-core/src/tools.shared.ts | Adds node:sqlite-missing detection and specialized unavailable warning/action messaging. |
| extensions/memory-core/src/tools.test.ts | Adds a test asserting the new node:sqlite-missing unavailable metadata. |
| export function buildMemorySearchUnavailableResult(error: string | undefined) { | ||
| const reason = (error ?? "memory search unavailable").trim() || "memory search unavailable"; | ||
| const isQuotaError = /insufficient_quota|quota|429/.test(reason.toLowerCase()); | ||
| const warning = isQuotaError | ||
| ? "Memory search is unavailable because the embedding provider quota is exhausted." | ||
| : "Memory search is unavailable due to an embedding/provider error."; | ||
| const action = isQuotaError | ||
| ? "Top up or switch embedding provider, then retry memory_search." | ||
| : "Check embedding provider configuration and retry memory_search."; | ||
| const lowerReason = reason.toLowerCase(); | ||
| const isQuotaError = /insufficient_quota|quota|429/.test(lowerReason); | ||
| const isSqliteError = /node:sqlite|missing.*sqlite|sqlite.*unavailable/.test(lowerReason); | ||
|
|
||
| let warning: string; | ||
| let action: string; | ||
| if (isQuotaError) { | ||
| warning = "Memory search is unavailable because the embedding provider quota is exhausted."; | ||
| action = "Top up or switch embedding provider, then retry memory_search."; | ||
| } else if (isSqliteError) { | ||
| warning = "Memory search is unavailable because the Node.js runtime is missing node:sqlite support."; | ||
| action = "Upgrade to Node.js 22.5.0+ (which includes node:sqlite) or use a Node build with SQLite enabled, then restart OpenClaw."; | ||
| } else { | ||
| warning = "Memory search is unavailable due to an embedding/provider error."; | ||
| action = "Check embedding provider configuration and retry memory_search."; | ||
| } |
There was a problem hiding this comment.
The PR title/description focus on --tz CLI help text, but this hunk also changes memory_search unavailable-result behavior for missing node:sqlite (and adds tests). Please update the PR description/title to reflect this additional scope, or split the memory-core change into a separate PR for easier review/revertability.
| action = "Top up or switch embedding provider, then retry memory_search."; | ||
| } else if (isSqliteError) { | ||
| warning = "Memory search is unavailable because the Node.js runtime is missing node:sqlite support."; | ||
| action = "Upgrade to Node.js 22.5.0+ (which includes node:sqlite) or use a Node build with SQLite enabled, then restart OpenClaw."; |
There was a problem hiding this comment.
The suggested remediation says to "Upgrade to Node.js 22.5.0+", but this repo declares engines.node >=22.14.0 (package.json). Recommending a lower version is confusing; consider aligning the message with the supported minimum (or phrasing it without a specific version) and update the corresponding test expectation.
| action = "Upgrade to Node.js 22.5.0+ (which includes node:sqlite) or use a Node build with SQLite enabled, then restart OpenClaw."; | |
| action = "Upgrade to Node.js 22.14.0+ (which includes node:sqlite) or use a Node build with SQLite enabled, then restart OpenClaw."; |
| @@ -42,7 +42,7 @@ export function registerCronEditCommand(cron: Command) { | |||
| .option("--at <when>", "Set one-shot time (ISO) or duration like 20m") | |||
There was a problem hiding this comment.
cron add's --at help text explicitly hints that --tz is used for offset-less datetimes, but cron edit's --at help does not. Since --tz now claims to apply to --at, consider updating the --at help here as well for consistent discoverability.
| .option("--at <when>", "Set one-shot time (ISO) or duration like 20m") | |
| .option( | |
| "--at <when>", | |
| "Set one-shot time (ISO, offset-less uses --tz) or duration like 20m", | |
| ) |
The --tz help text said 'Timezone for cron expressions' implying it only applies to --cron. Updated to mention --at too. Closes openclaw#59456
4a0cf27 to
8ba618b
Compare
|
Related work from PRtags group Title: Open PR duplicate: cron --tz help text clarification for offset-less --at
|
Summary
The
--tzhelp text in bothopenclaw cron addandopenclaw cron editsays "Timezone for cron expressions" — implying it only applies to--cron. Updated to "Timezone for cron and --at expressions" so users know--tzalso applies to--atdatetime strings.Fixes #59456
🤖 AI-assisted (Claude Code). I understand what the code does.
Changes
src/cli/cron-cli/register.cron-add.ts"Timezone for cron expressions (IANA)"→"Timezone for cron and --at expressions (IANA)"src/cli/cron-cli/register.cron-edit.tsTest plan
openclaw cron add --helpand verify updated help textopenclaw cron edit --helpand verify updated help text