Skip to content

feat(cron): add compact list responses#93395

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
yu-xin-c:openmeta/93366-cron-list-compact
Jun 16, 2026
Merged

feat(cron): add compact list responses#93395
vincentkoc merged 1 commit into
openclaw:mainfrom
yu-xin-c:openmeta/93366-cron-list-compact

Conversation

@yu-xin-c

Copy link
Copy Markdown
Contributor

Summary

Adds an opt-in compact response mode for cron list calls.

  • cron.list now accepts compact: true and returns lightweight job summaries with id, name, enabled, nextRunAtMs, scheduleKind, and lastRunStatus.
  • cron(action: "list") exposes and forwards the same compact parameter from the agent tool.
  • Default list behavior is unchanged: callers that omit compact still receive full job objects plus delivery previews.

Fixes #93366.

Real behavior proof

Behavior addressed: cron.list / cron(action: "list") can list many jobs with a lightweight summary payload when callers pass compact: true, avoiding full payload, delivery, session target, and schedule detail unless the caller asks for full list output.

Real environment tested: local OpenClaw source checkout on macOS/Darwin with Node v25.9.0; gateway cron handler, protocol validators, and agent cron tool tests executed through the repository scripts/run-vitest.mjs runner. Core TypeScript was checked with scripts/run-tsgo.mjs.

Exact steps or command run after this patch:

node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental false
node scripts/run-vitest.mjs packages/gateway-protocol/src/cron-validators.test.ts src/cron/service.list-page-sort-guards.test.ts src/gateway/server-methods/cron.validation.test.ts src/agents/tools/cron-tool.test.ts src/agents/tools/cron-tool.schema.test.ts
git diff --check

Evidence after fix: the gateway handler test exercises a full CronJob returned by the cron service and verifies the compact: true RPC response contains only the six compact fields and omits delivery previews. The agent tool test verifies cron(action: "list", compact: true) forwards compact: true to cron.list. The protocol validator test verifies compact is accepted by CronListParamsSchema.

Observed result after fix: targeted Vitest run passed 5 shards: protocol validators, gateway cron validation, cron list paging guards, cron tool behavior, and cron tool schema. tsgo completed successfully for tsconfig.core.json. git diff --check passed.

What was not tested: a live Gateway process with 30+ real cron jobs and WebSocket transport truncation; native CLI openclaw cron list output because this PR adds an RPC/tool parameter, not a CLI flag.

Verification

  • node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental false
  • node scripts/run-vitest.mjs packages/gateway-protocol/src/cron-validators.test.ts src/cron/service.list-page-sort-guards.test.ts src/gateway/server-methods/cron.validation.test.ts src/agents/tools/cron-tool.test.ts src/agents/tools/cron-tool.schema.test.ts
  • git diff --check

Risk

Low compatibility risk. The new parameter is opt-in, and the non-compact path still returns the existing full page shape with deliveryPreviews.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: S triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 15, 2026
@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 15, 2026, 2:35 PM ET / 18:35 UTC.

Summary
The PR adds an opt-in compact flag to Gateway cron.list and agent cron(action: "list"), returning six-field job summaries while documenting and testing the new path.

PR surface: Source +36, Tests +108, Docs +2. Total +146 across 8 files.

Reproducibility: no. high-confidence live reproduction was established in this read-only review. Source inspection shows current main cannot accept compact and always returns full cron jobs plus delivery previews, matching the linked issue's reported failure mode.

Review metrics: 1 noteworthy metric.

  • Additive public parameter: 1 added, exposed on 2 caller surfaces. compact is added to both Gateway cron.list and the agent cron tool, so maintainers should notice the new public API surface before merge.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🧂 unranked krab
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:

  • [P1] Add redacted terminal output, logs, copied live output, or a short recording from a real Gateway or agent-tool cron.list call with compact: true and multiple cron jobs.
  • Also show that omitting compact still returns the existing full response shape.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body reports targeted tests, typecheck, and diff check, but no after-fix real Gateway, WebSocket, or agent-tool run with real cron jobs; the contributor should add redacted terminal output, logs, copied live output, or a short recording and update the PR body to trigger re-review.

Risk before merge

  • [P1] Contributor proof is limited to targeted tests, typecheck, and diff check; the real Gateway, WebSocket, or agent-tool path with multiple real cron jobs remains unproven.
  • [P1] This adds a public Gateway/tool parameter, so maintainers should confirm the API shape and wording before treating it as a permanent surface.

Maintainer options:

  1. Decide the mitigation before merge
    Land the additive compact list path after maintainers accept the public API shape and the contributor adds real Gateway or agent-tool proof showing compact and default full responses.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] This PR needs contributor real behavior proof and maintainer API review; there is no narrow code repair for ClawSweeper to queue.

Security
Cleared: The diff only changes cron RPC/tool/docs/tests and does not add dependencies, workflows, secrets handling, package metadata, or new third-party code execution paths.

Review details

Best possible solution:

Land the additive compact list path after maintainers accept the public API shape and the contributor adds real Gateway or agent-tool proof showing compact and default full responses.

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

No high-confidence live reproduction was established in this read-only review. Source inspection shows current main cannot accept compact and always returns full cron jobs plus delivery previews, matching the linked issue's reported failure mode.

Is this the best way to solve the issue?

Yes, pending maintainer API acceptance: the opt-in Gateway/tool parameter is the narrowest maintainable shape because it preserves default output and keeps the cron service list contract full-job based. The missing piece is real behavior proof from a live-style cron list call.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a normal-priority cron tool reliability improvement with limited blast radius because the new response mode is opt-in.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🧂 unranked krab 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: The PR body reports targeted tests, typecheck, and diff check, but no after-fix real Gateway, WebSocket, or agent-tool run with real cron jobs; the contributor should add redacted terminal output, logs, copied live output, or a short recording and update the PR body to trigger re-review.
Evidence reviewed

PR surface:

Source +36, Tests +108, Docs +2. Total +146 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 3 38 2 +36
Tests 4 108 0 +108
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 148 2 +146

What I checked:

  • Repository policy read: Root and scoped AGENTS.md files were read; the review applied the gateway/protocol additive-change guidance, PR proof gate, and scoped gateway/agent/docs rules. (AGENTS.md:23, c40db057da33)
  • Current main has no compact request parameter: Current CronListParamsSchema accepts paging, filters, sorting, and agentId with additionalProperties: false, but no compact key, so the requested parameter is not already implemented on main. (packages/gateway-protocol/src/schema/cron.ts:453, c40db057da33)
  • Current main returns full list payloads: The current cron.list handler always calls context.cron.listPage, resolves delivery previews for full jobs, and responds with { ...page, deliveryPreviews }; there is no compact projection branch. (src/gateway/server-methods/cron.ts:309, c40db057da33)
  • Current agent tool cannot forward compact: The current cron tool schema exposes includeDisabled but no compact, and the list action forwards only includeDisabled, agentId, and scoped pagination to cron.list. (src/agents/tools/cron-tool.ts:303, c40db057da33)
  • Service contract remains full-job pagination: CronListPageResult is still typed around full CronJob[], so keeping the compact projection at the Gateway response boundary avoids changing the cron service list contract. (src/cron/service/list-page-types.ts:33, c40db057da33)
  • PR diff implements the new compact path: The PR diff adds compact to the protocol schema and agent tool schema, forwards it from the tool, and adds a gateway response projection that omits delivery previews for compact list responses. (src/gateway/server-methods/cron.ts:52, 278430846cea)

Likely related people:

  • Tosko4: Local blame attributes the current cron Gateway handler, protocol schema, agent tool, and listPage snapshot to commit 8f9493c213e9, which carries the current behavior this PR extends. (role: current-main history carrier; confidence: medium; commits: 8f9493c213e9; files: src/gateway/server-methods/cron.ts, packages/gateway-protocol/src/schema/cron.ts, src/agents/tools/cron-tool.ts)
  • Michael Appel: Recent current-main history touched src/agents/tools/cron-tool.ts for scheduled turn tool policy, adjacent to the agent-facing list path this PR extends. (role: recent cron tool contributor; confidence: medium; commits: cc000e0ffee9; files: src/agents/tools/cron-tool.ts, src/agents/tools/cron-tool.test.ts)
  • BryanTegomoh: The earlier closed unmerged compact cron-list PR implemented the same feature shape and remains useful routing context, though it is not current-main ownership. (role: prior related implementation author; confidence: medium; commits: 3ae8fd577667; files: src/agents/tools/cron-tool.ts, src/cron/service/ops.ts, src/gateway/server-methods/cron.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 Jun 15, 2026
@vincentkoc vincentkoc force-pushed the openmeta/93366-cron-list-compact branch from 2784308 to 6d836f8 Compare June 16, 2026 06:15
@vincentkoc vincentkoc marked this pull request as ready for review June 16, 2026 06:15
@vincentkoc vincentkoc self-assigned this Jun 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Jun 16, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Land-ready canonical fix for #93366.

  • Compact projection stays at the Gateway/tool boundary; the cron service contract remains full-job-only.
  • compact: true returns only the documented summary fields, skips delivery-preview resolution, and the agent tool falls back exactly when older protocol-v4 Gateways reject the additive field.
  • Focused proof passed: 175 tests; protocol generation stable; docs listing, oxfmt, and git diff --check passed; fresh autoreview is clean.
  • Known gap: remote Crabbox check:changed run run_9549f1993c8f could not obtain an Azure coordinator lease, so I applied the documented maintainer proof: override.

@vincentkoc vincentkoc force-pushed the openmeta/93366-cron-list-compact branch from 6d836f8 to e2496a9 Compare June 16, 2026 06:25
@vincentkoc vincentkoc added the proof: override Maintainer override for the external PR real behavior proof gate. label Jun 16, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. label Jun 16, 2026
@vincentkoc vincentkoc force-pushed the openmeta/93366-cron-list-compact branch from e2496a9 to 4965e7e Compare June 16, 2026 06:39
@vincentkoc vincentkoc merged commit ca1a53a into openclaw:main Jun 16, 2026
37 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

Thanks @yu-xin-c!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 17, 2026
Merged via squash.

Prepared head SHA: 4965e7e
Co-authored-by: yu-xin-c <175149126+yu-xin-c@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Reviewed-by: @vincentkoc
crh-code pushed a commit to crh-code/openclaw that referenced this pull request Jun 18, 2026
Merged via squash.

Prepared head SHA: 4965e7e
Co-authored-by: yu-xin-c <175149126+yu-xin-c@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Reviewed-by: @vincentkoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: override Maintainer override for the external PR real behavior proof gate. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add compact parameter to cron list tool to reduce response verbosity

2 participants