Skip to content

fix(cron): use direct lookup instead of paginated search in cron edit - #100836

Merged
vincentkoc merged 4 commits into
openclaw:mainfrom
machine3at:fix/2.2-cron-edit-direct-lookup
Jul 6, 2026
Merged

vincentkoc merged 4 commits into
openclaw:mainfrom
machine3at:fix/2.2-cron-edit-direct-lookup

Conversation

@machine3at

@machine3at machine3at commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. size: S and removed size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 6, 2026
@clawsweeper

clawsweeper Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 6, 2026, 7:32 AM ET / 11:32 UTC.

Summary
This PR changes openclaw cron edit schedule and timeout-only payload lookups to call cron.get directly and updates cron CLI tests that expected paginated cron.list lookups.

PR surface: Source -33, Tests -108. Total -141 across 3 files.

Reproducibility: yes. source inspection on current main shows cron edit --exact and timeout-only edit lookups call loadCronJobForEditSchedulePatch, which pages cron.list. I did not run a live large-gateway timing repro.

Review metrics: 1 noteworthy metric.

  • Cron edit lookup fanout: up to 50 paginated list calls replaced by 1 get call. This quantifies the maintainer-visible performance behavior the PR is changing before merge.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Add redacted terminal output or logs from a real openclaw cron edit <id> --exact or timeout-only edit run against a Gateway, showing the command succeeds and the lookup uses cron.get.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Mock-only: the PR body shows Vitest output, but no real CLI/Gateway run or redacted logs demonstrate the after-fix direct lookup; updating the PR body with that proof should trigger a fresh ClawSweeper review, or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] Contributor evidence is mocked test output only; no redacted live CLI/Gateway transcript or runtime log shows the after-fix cron edit path using cron.get against an existing job.

Maintainer options:

  1. Decide the mitigation before merge
    Land the direct cron.get lookup after the contributor adds redacted real CLI/Gateway proof showing cron edit succeeds without paginated list calls.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The remaining blocker is contributor-supplied real behavior proof before merge; there is no narrow code repair for ClawSweeper to queue.

Security
Cleared: The diff only changes CLI cron RPC method selection and related tests; it does not touch dependencies, workflows, secrets, package resolution, or code-execution policy.

Review details

Best possible solution:

Land the direct cron.get lookup after the contributor adds redacted real CLI/Gateway proof showing cron edit succeeds without paginated list calls.

Do we have a high-confidence way to reproduce the issue?

Yes, source inspection on current main shows cron edit --exact and timeout-only edit lookups call loadCronJobForEditSchedulePatch, which pages cron.list. I did not run a live large-gateway timing repro.

Is this the best way to solve the issue?

Yes, this is the narrowest maintainable fix because cron.get already exists for id-addressed single-job reads. Keeping pagination or adding another list filter would duplicate the existing Gateway contract, while cron show can remain list-backed because it also accepts names.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 96e676c2b35a.

Label changes

Label changes:

  • add P2: This is a bounded CLI performance fix for cron edit with limited blast radius and no user-blocking or security evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Mock-only: the PR body shows Vitest output, but no real CLI/Gateway run or redacted logs demonstrate the after-fix direct lookup; updating the PR body with that proof should trigger a fresh ClawSweeper review, or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded CLI performance fix for cron edit with limited blast radius and no user-blocking or security evidence.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Mock-only: the PR body shows Vitest output, but no real CLI/Gateway run or redacted logs demonstrate the after-fix direct lookup; updating the PR body with that proof should trigger a fresh ClawSweeper review, or a maintainer can request @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source -33, Tests -108. Total -141 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 36 -33
Tests 2 9 117 -108
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 12 153 -141

What I checked:

  • Repository policy read: Read the full root AGENTS.md and found no scoped AGENTS.md under src/cli; the root review policy required whole-path review, source/history evidence, no changelog finding, and external-PR real behavior proof gating. (AGENTS.md:1, 96e676c2b35a)
  • Current main uses paginated cron.list for edit lookup: Current main defines loadCronJobForEditSchedulePatch, which pages cron.list with includeDisabled, limit 200, and up to 50 pages to find the edited job by id. (src/cli/cron-cli/register.cron-edit.ts:42, 96e676c2b35a)
  • PR replaces the lookup with cron.get: The PR diff removes the paginated helper and changes both patch-existing-cron and timeout-only payload-kind reads to readCronJobForEdit, which calls cron.get with the job id. (src/cli/cron-cli/register.cron-edit.ts:247, 5edb8f6382cb)
  • cron.get is an existing direct-read contract: The Gateway cron.get handler validates the id, calls context.cron.readJob(jobId), preserves caller-scope filtering, and returns a single cronJobReadView, so the PR uses an existing API instead of adding a new surface. (src/gateway/server-methods/cron.ts:400, 96e676c2b35a)
  • Adjacent tests cover affected edit paths: Cron edit tests already exercise schedule metadata edits and timeout-only payload-kind preservation; the shared test lookup helper currently mocks both cron.list and cron.get, and the PR updates timeout-only mocks to use cron.get. (src/cli/cron-cli.test.ts:204, 96e676c2b35a)
  • Direct cron.get provenance: Merged PR [Feat] Add single-job cron get path #75117 added the cron.get path in commit d52ac64, touching CLI, Gateway protocol, server methods, service, docs, and tests. (src/gateway/server-methods/cron.ts:400, d52ac6418247)

Likely related people:

  • steipete: Current-main blame attributes the cron edit lookup helper and readCronJobForEdit lines to Peter Steinberger's recent cron CLI split, and earlier history shows Peter extracted the cron schedule/test helpers this code uses. (role: recent area contributor; confidence: high; commits: ae6dc52da934, 3ae5d337997e; files: src/cli/cron-cli/register.cron-edit.ts, src/cli/cron-cli/schedule-options.ts, src/cli/cron-cli.test.ts)
  • samzong: Commit d52ac64 from merged PR [Feat] Add single-job cron get path #75117 added the cron.get API and CLI surface this PR now reuses. (role: introduced direct cron get path; confidence: high; commits: d52ac6418247; files: src/cli/cron-cli/register.cron-simple.ts, src/gateway/server-methods/cron.ts, src/gateway/protocol/schema/cron.ts)
  • Takhoffman: Commit 77c3b14 changed cron edit parity, all-jobs run history, cron server methods, cron service code, and UI cron surfaces, making this a relevant adjacent routing signal. (role: adjacent cron surface contributor; confidence: medium; commits: 77c3b142a966; files: src/gateway/server-methods/cron.ts, src/cron/service.ts, src/cron/service/ops.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 6, 2026
@vincentkoc vincentkoc self-assigned this Jul 6, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts docker Docker and sandbox tooling size: M triage: blank-template Candidate: PR template appears mostly untouched. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed size: S labels Jul 6, 2026
@vincentkoc vincentkoc added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 6, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer repair and land-ready proof are complete on exact head ab4576276d4298130a29c314bdf74ecc7683a054.

What changed:

  • kept the contributor's direct cron.get fast path;
  • added a bounded cron.list fallback only for the exact older-Gateway unknown-method response;
  • preserved the caught Gateway error as cause when the fallback cannot find the job;
  • strengthened direct/fallback unit coverage and extended the packaged Docker cron CLI smoke through exact and timeout-only edits.

Proof:

  • Blacksmith Testbox tbx_01kwvs0xzs1szbfryw9ddzkedt: focused cron CLI suite 125/125 passed; packaged pnpm test:docker:cron-cli passed.
  • node scripts/run-vitest.mjs src/cli/cron-cli/register.cron-edit.test.ts: 22/22 passed after the lint follow-up.
  • Exact oxlint invocation for src/cli/cron-cli/register.cron-edit.ts: passed.
  • Full-branch autoreview: clean, confidence 0.86.
  • Follow-up autoreview: clean, confidence 0.92.
  • Exact-head CI, including QA Smoke: https://github.com/openclaw/openclaw/actions/runs/28796023676
  • Native scripts/pr review-validate-artifacts 100836: passed.
  • Native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 100836: passed with hosted exact-head gates.

Known proof note: one earlier ad hoc Testbox check:changed sync included remote node_modules and failed an unrelated shrinkwrap guard. The clean exact-head GitHub CI run supersedes that polluted probe.

@vincentkoc
vincentkoc merged commit 5c2604f into openclaw:main Jul 6, 2026
116 of 124 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
…openclaw#100836)

* fix(cron): use direct lookup instead of paginated search in cron edit

* fix(test): update cron-cli tests to mock cron.get and remove obsolete pagination checks

* fix(cron): preserve edit compatibility with older gateways

* fix(cron): preserve legacy lookup error cause

---------

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docker Docker and sandbox tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: blank-template Candidate: PR template appears mostly untouched. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants