Skip to content

fix: clarify --tz help text to mention --at support (#59456)#59480

Closed
lawrence3699 wants to merge 1 commit into
openclaw:mainfrom
lawrence3699:fix/59456-tz-help-text
Closed

fix: clarify --tz help text to mention --at support (#59456)#59480
lawrence3699 wants to merge 1 commit into
openclaw:mainfrom
lawrence3699:fix/59456-tz-help-text

Conversation

@lawrence3699

Copy link
Copy Markdown
Contributor

Summary

The --tz help text in both openclaw cron add and openclaw cron edit says "Timezone for cron expressions" — implying it only applies to --cron. Updated to "Timezone for cron and --at expressions" so users know --tz also applies to --at datetime strings.

Fixes #59456

🤖 AI-assisted (Claude Code). I understand what the code does.

Changes

File Change
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.ts Same

Test plan

  • Run openclaw cron add --help and verify updated help text
  • Run openclaw cron edit --help and verify updated help text

Copilot AI review requested due to automatic review settings April 2, 2026 06:06
@openclaw-barnacle openclaw-barnacle Bot added extensions: memory-core Extension: memory-core cli CLI command changes size: XS labels Apr 2, 2026
@greptile-apps

greptile-apps Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the --tz flag help text in openclaw cron add and openclaw cron edit to clarify it applies to both --cron and --at expressions. The change is correct and matches the actual runtime behavior.

However, the PR also bundles unrelated changes to extensions/memory-core/src/tools.shared.ts and its test file that are not mentioned in the PR title, description, or changelog table. Those changes add a new isSqliteError detection path (regex: /node:sqlite|missing.*sqlite|sqlite.*unavailable/) to buildMemorySearchUnavailableResult, giving users a specific, actionable message when node:sqlite is unavailable instead of the generic embedding-provider error. The logic and test coverage for this new branch look correct.

Key points:

  • The --tz help text fix is a trivial, accurate one-liner in two files.
  • The memory-core error-handling improvement is small, well-tested, and logically sound — but it belongs in a separate PR or at least should be called out in the description.
  • The lowerReason extraction is a minor cleanup that avoids calling .toLowerCase() twice.
  • Priority ordering in the if-else chain (isQuotaError checked before isSqliteError) is correct; a message containing both "quota" and "sqlite" will resolve to the quota path.

Confidence Score: 4/5

  • Safe to merge — all code changes are correct and well-tested; the only concern is that the memory-core changes are undocumented in the PR description.
  • Both sets of changes are small and low-risk. The cron help-text edits are trivially correct. The memory-core addition is backed by a dedicated test that passes against the exact regex. No existing behavior is altered; only a new else-if branch is added. Score is 4 rather than 5 solely because the PR bundles unrelated, undescribed changes, making the review surface slightly larger than advertised.
  • extensions/memory-core/src/tools.shared.ts — contains changes not mentioned in the PR description.

Reviews (1): Last reviewed commit: "fix: clarify --tz help text to mention -..." | Re-trigger Greptile

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --tz help text to mention --at usage.
  • Classify missing node:sqlite failures in memory_search and 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.

Comment on lines +110 to +127
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.";
}

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
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.";

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.";

Copilot uses AI. Check for mistakes.
@@ -42,7 +42,7 @@ export function registerCronEditCommand(cron: Command) {
.option("--at <when>", "Set one-shot time (ISO) or duration like 20m")

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
.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",
)

Copilot uses AI. Check for mistakes.
The --tz help text said 'Timezone for cron expressions' implying it
only applies to --cron. Updated to mention --at too.

Closes openclaw#59456
@lawrence3699
lawrence3699 force-pushed the fix/59456-tz-help-text branch from 4a0cf27 to 8ba618b Compare April 2, 2026 06:50
@openclaw-barnacle openclaw-barnacle Bot removed the extensions: memory-core Extension: memory-core label Apr 2, 2026
@lawrence3699
lawrence3699 deleted the fix/59456-tz-help-text branch April 3, 2026 22:51
@prtags

prtags Bot commented Apr 23, 2026

Copy link
Copy Markdown

Related work from PRtags group tidy-squirrel-pxzl

Title: Open PR duplicate: cron --tz help text clarification for offset-less --at

Number Title
#59480* fix: clarify --tz help text to mention --at support (#59456)
#59487 fix(cli): clarify --tz help text to cover --at time-only format
#69975 fix(cli): clarify --tz help text for offset-less --at values

* This PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs/UX]: help text is misleading — says "cron expressions" only, but should also apply to datetime strings

2 participants