openclaw - ✅(Solved) Fix [Feature]: add single-job inspection by id [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#67671Fetched 2026-04-17 08:29:47
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1labeled ×1

Add single-job cron inspection by id so callers can fetch one cron job directly instead of listing and filtering the full job set.

Error Message

  • Return a clean error when the id does not exist

Root Cause

  • Continue using openclaw cron list --json and filter client-side. This is weaker because it forces full-list retrieval even when the caller already knows the id, which is wasteful for agents and scripts.

Fix Action

Fix / Workaround

For agent-driven workflows, this is especially costly because the current workaround requires sending the full cron job set through the model path even when only one job is relevant.

Current workaround:

PR fix notes

PR #67677: fix(cron): add single-job get path for id-based inspection

Description (problem / solution / changelog)

Summary

  • Problem: openclaw cron only supports full-job inspection via cron list --json, so consumers must fetch and filter the entire job set even when they already know the target job id.
  • Why it matters: this is inconsistent with existing id-based cron operations and wastes payload/token budget for agent-driven, scripted, and debugging workflows.
  • What changed: added cron.get plus openclaw cron get <id> for single-job inspection.
  • What did NOT change (scope boundary): no scheduling, execution, delivery, or existing cron list behavior changed.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #67671
  • Related #
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: cron jobs are already modeled as id-addressable resources for mutate operations (edit, run, rm), but the CLI/RPC surface did not expose a matching single-job read path.
  • Missing detection / guardrail: there was no test coverage asserting parity between id-based cron mutation and id-based cron inspection.
  • Contributing context (if known): callers that already knew a job id still had to fetch the full job list and filter client-side.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file:
    • src/cli/cron-cli.test.ts
    • src/gateway/protocol/cron-validators.test.ts
    • src/gateway/server.cron.test.ts
  • Scenario the test should lock in: a caller can fetch one cron job by id through both CLI and gateway RPC, and missing ids fail cleanly.
  • Why this is the smallest reliable guardrail: the change is a CLI/protocol/server seam addition, so those seams are the narrowest place to lock the behavior.
  • Existing test that already covers this (if any): none.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

  • Added openclaw cron get <id> for single-job inspection.
  • Added gateway RPC cron.get.
  • Added the same single-job inspection path to the cron agent tool.

Diagram (if applicable)

Before:
[caller knows job id] -> [cron list --json] -> [filter full job set client-side]

After:
[caller knows job id] -> [cron get <id>] -> [single job payload]

## Changed files

- `docs/automation/cron-jobs.md` (modified, +1/-0)
- `docs/cli/cron.md` (modified, +8/-0)
- `docs/cli/index.md` (modified, +1/-0)
- `src/agents/tools-effective-inventory.test.ts` (modified, +2/-2)
- `src/agents/tools/cron-tool.ts` (modified, +20/-2)
- `src/cli/cron-cli.test.ts` (modified, +10/-0)
- `src/cli/cron-cli/register.cron-simple.ts` (modified, +15/-0)
- `src/cron/service-contract.ts` (modified, +1/-0)
- `src/cron/service.ts` (modified, +4/-0)
- `src/cron/service/ops.ts` (modified, +7/-0)
- `src/gateway/method-scopes.ts` (modified, +1/-0)
- `src/gateway/protocol/cron-validators.test.ts` (modified, +6/-0)
- `src/gateway/protocol/index.ts` (modified, +5/-0)
- `src/gateway/protocol/schema/cron.ts` (modified, +2/-0)
- `src/gateway/protocol/schema/protocol-schemas.ts` (modified, +2/-0)
- `src/gateway/protocol/schema/types.ts` (modified, +1/-0)
- `src/gateway/server-methods-list.ts` (modified, +1/-0)
- `src/gateway/server-methods/cron.ts` (modified, +34/-0)
- `src/gateway/server.cron.test.ts` (modified, +25/-0)
RAW_BUFFERClick to expand / collapse

Summary

Add single-job cron inspection by id so callers can fetch one cron job directly instead of listing and filtering the full job set.

Problem to solve

openclaw cron currently only exposes detailed cron job inspection through cron list --json, so callers must fetch and filter the entire cron job set even when they already know the target job id.

This is inefficient for agent-driven and scripted workflows. In my case, an OpenClaw agent needs to inspect one cron job's full definition, but today it has to call cron list --json and consume the whole job list first. That increases payload size and token cost unnecessarily.

It is also inconsistent with the existing cron command surface, where cron jobs are already treated as id-addressable resources for mutation:

  • openclaw cron edit <id>
  • openclaw cron run <id>
  • openclaw cron rm <id>

The read path is the missing piece.

Proposed solution

Add a single-job read path for cron jobs.

Desired behavior:

  • CLI: openclaw cron get <id>
  • Gateway RPC: cron.get
  • Return the full stored cron job definition for the requested id
  • Return a clean error when the id does not exist

Scope boundary:

  • no change to cron scheduling
  • no change to cron execution
  • no change to delivery behavior
  • no change to existing cron list behavior

This should be a minimal additive read API for an already id-addressable cron resource.

Alternatives considered

  • Continue using openclaw cron list --json and filter client-side. This is weaker because it forces full-list retrieval even when the caller already knows the id, which is wasteful for agents and scripts.

  • Add an --id filter to cron list. This is weaker because it overloads collection-listing semantics instead of exposing a proper single-resource read path. cron.get is a cleaner match for the existing id-based cron operations.

Impact

Affected: OpenClaw agents, scripted workflows, and operators who need to inspect one cron job in detail Severity: Low to medium Frequency: Repeated whenever single-job inspection is needed Consequence: unnecessary payload expansion, avoidable token usage, and extra client-side filtering logic

For agent-driven workflows, this is especially costly because the current workaround requires sending the full cron job set through the model path even when only one job is relevant.

Evidence/examples

Current workaround:

  • call openclaw cron list --json
  • filter the returned job array client-side by id

Example use case: an OpenClaw agent wants to inspect one cron job's message, delivery mode, schedule, or session target, but currently has no direct get by id path.

The existing command surface already supports id-based mutation:

  • openclaw cron edit <id>
  • openclaw cron run <id>
  • openclaw cron rm <id>

That suggests single-job inspection is the missing complementary read capability.

Additional information

I already implemented and tested a minimal additive version locally with:

  • openclaw cron get <id>
  • cron.get gateway RPC

The change is intentionally small and limited to single-job inspection.

Local validation:

  • targeted CLI/protocol/server cron tests passed
  • pnpm check passed
  • full pnpm test in this checkout was not fully green, but the observed failures were outside the cron surface

extent analysis

TL;DR

Implement a cron.get gateway RPC and openclaw cron get <id> CLI command to enable direct inspection of a single cron job by id.

Guidance

  • Introduce a new cron.get RPC endpoint that takes a cron job id as input and returns the full stored cron job definition.
  • Implement the openclaw cron get <id> CLI command to call the cron.get RPC endpoint and display the result.
  • Ensure the new endpoint and CLI command handle cases where the provided id does not exist, returning a clean error message.
  • Verify the implementation by testing the new CLI command and RPC endpoint with various cron job ids, including non-existent ones.

Example

# Example usage of the new CLI command
openclaw cron get <job_id>

# Example RPC call
cron.get <job_id>

Notes

The proposed solution is intentionally small and limited to single-job inspection, which should minimize the impact on existing functionality. However, thorough testing is still necessary to ensure the new feature works correctly and does not introduce any regressions.

Recommendation

Apply the proposed solution by implementing the cron.get gateway RPC and openclaw cron get <id> CLI command, as it provides a clean and efficient way to inspect a single cron job by id, consistent with the existing command surface.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Feature]: add single-job inspection by id [1 pull requests, 1 participants]