Skip to content

feat(cron): add agentId filtering to cron list#77602

Merged
clawsweeper[bot] merged 5 commits intomainfrom
clawsweeper/automerge-openclaw-openclaw-77188
May 5, 2026
Merged

feat(cron): add agentId filtering to cron list#77602
clawsweeper[bot] merged 5 commits intomainfrom
clawsweeper/automerge-openclaw-openclaw-77188

Conversation

@clawsweeper
Copy link
Copy Markdown
Contributor

@clawsweeper clawsweeper Bot commented May 5, 2026

Summary

  • Repair feat(cron): add agentId filtering to cron list #77188 in place by normalizing requested agent IDs before cron list filtering.
  • Keep CLI cron list backward compatible when --agent is omitted, while allowing explicit filtering.
  • Document the new cron list agent filter and add the required changelog entry.

Closes #77118. This carries forward the implementation and credit from @zhanggttry in #77188.

Verification

  • pnpm test src/cron/service.list-page-sort-guards.test.ts src/gateway/protocol/cron-validators.test.ts
  • pnpm check:changed

ClawSweeper 🐠 replacement reef notes:

fish notes: model gpt-5.5, reasoning high; reviewed against dab0e0a.

@clawsweeper clawsweeper Bot added app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes agents Agent runtime and tooling labels May 5, 2026
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label May 5, 2026
@clawsweeper clawsweeper Bot added size: XS clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge labels May 5, 2026
@clawsweeper clawsweeper Bot added the clawsweeper Tracked by ClawSweeper automation label May 5, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor Author

clawsweeper Bot commented May 5, 2026

Codex review: passed.

Summary
This PR adds optional agentId filtering to cron.list, auto-fills it for agent tool calls, exposes openclaw cron list --agent, updates generated protocol clients, docs, changelog, tests, and prompt fixtures.

Reproducibility: yes. The motivating behavior is source-reproducible on current main because cron tool, CLI, gateway schema, and service list paths do not accept or apply agentId; the PR diff adds that path with focused regression coverage.

Real behavior proof
Not applicable: This is a ClawSweeper bot replacement PR, so the external-contributor real behavior proof gate does not apply.

Next step before merge
No repair lane is needed; this automerge-opted bot PR has no review findings and exact-head checks can gate merge.

Security
Cleared: The diff adds cron filtering, docs, generated protocol models, tests, fixtures, and changelog text without changing secrets, dependencies, CI permissions, package resolution, or code-execution paths.

Review details

Best possible solution:

Land the repaired PR through the normal automerge gates, preserving the source contributor credit and letting the merge close #77118.

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

Yes. The motivating behavior is source-reproducible on current main because cron tool, CLI, gateway schema, and service list paths do not accept or apply agentId; the PR diff adds that path with focused regression coverage.

Is this the best way to solve the issue?

Yes. The PR uses an additive protocol field and CLI option, keeps unfiltered CLI behavior when --agent is omitted, and centralizes effective-agent matching in the cron service, which is the narrow maintainable solution.

What I checked:

  • Current main lacks cron list filtering: On current main, the cron tool list action only sends includeDisabled, the CLI list command has no --agent, the gateway schema lacks agentId, and listPage filters only enabled/query before sorting. (src/agents/tools/cron-tool.ts:656, a17d4371d101)
  • PR implements the requested additive filter path: The PR diff adds agentId to the cron tool schema and description, auto-fills list calls from the requester session when omitted, passes it through the gateway schema/handler, and filters service results after normalizing requested and effective job agent IDs. (src/cron/service/ops.ts:274, 35b692bc9708)
  • CLI/docs/tests cover the behavior: The diff adds openclaw cron list --agent <id>, documents that unfiltered CLI list remains the default, and adds tests for CLI normalization, agent-tool session defaults, protocol validation, and default-agent matching for jobs without stored agent IDs. (src/cli/cron-cli.test.ts:481, 35b692bc9708)
  • Earlier prompt snapshot blocker was repaired: The repaired head updates the three Codex dynamic-tool JSON fixtures with the new list description and agentId schema plus the matching token-count fixture summaries. (test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path/codex-dynamic-tools.telegram-direct.json:200, 35b692bc9708)
  • Exact-head checks are clean: Public GitHub API reports the PR head 35b692bc9708 is mergeable/clean, with check pages showing no non-success conclusions beyond skipped/neutral checks; aggregate check, check-additional, checks-node-core, and build-smoke are successful. (35b692bc9708)

Likely related people:

  • steipete: Current-main blame and recent history tie the cron tool description and cron service listPage implementation to Peter Steinberger's recent cron/tool work, making him the clearest maintainer route for this surface. (role: recent maintainer; confidence: high; commits: e0fafdcc1d1d, e86b38f09d85, 96d17f3cb191; files: src/agents/tools/cron-tool.ts, src/cron/service/ops.ts, src/gateway/protocol/schema/cron.ts)
  • zhanggttry: The replacement PR explicitly carries forward the implementation and credit from the closed source PR feat(cron): add agentId filtering to cron list #77188, whose commits introduced the agentId cron list filtering design now present in this branch. (role: source implementation contributor; confidence: medium; commits: f9b2fcc33af0, 26090a9fabeb; files: src/agents/tools/cron-tool.ts, src/cli/cron-cli/register.cron-add.ts, src/cron/service/ops.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against a17d4371d101.

@clawsweeper
Copy link
Copy Markdown
Contributor Author

clawsweeper Bot commented May 5, 2026

🦞🔧
ClawSweeper applied a repair to this PR branch.

Repair: kept the fix on this contributor branch instead of opening a replacement PR.
Validation: pnpm check:changed
Updated head: 35b692bc9708
Run: https://github.com/openclaw/clawsweeper/actions/runs/25359852638

Current state: exact-head review queued immediately; GitHub checks and the review verdict gate final merge.

Automerge progress:

  • 2026-05-05 01:01:44 UTC review queued 068caa773c85 (queued)
  • 2026-05-05 01:09:37 UTC review requested repair 068caa773c85 (structured ClawSweeper marker: fix-required (finding=review-feedback sha=068caa...)
  • 2026-05-05 05:58:55 UTC review queued 35b692bc9708 (after repair)

@clawsweeper clawsweeper Bot force-pushed the clawsweeper/automerge-openclaw-openclaw-77188 branch from dab0e0a to 068caa7 Compare May 5, 2026 01:00
zhanggttry and others added 5 commits May 5, 2026 05:58
Adds optional agentId parameter to cron list action, allowing agents
to filter cron jobs by their own agentId. This reduces noise in
multi-agent setups where each agent sees all jobs across all agents.

Changes:
- Protocol schema: add optional agentId to CronListParamsSchema
- Service types: add agentId to CronListPageOptions
- Service ops: filter by agentId when provided
- Gateway handler: pass through agentId param
- Agent tool: auto-fill agentId from session context (like cron add)
- CLI: add --agent <id> option to 'openclaw cron list'

When called from an agent session without explicit agentId, the tool
auto-fills it from the calling agent's session context. When called
from CLI without --agent, all jobs are shown (backward compatible).

Closes #77118
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: macos App: macos app: web-ui App: web-ui clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge clawsweeper Tracked by ClawSweeper automation cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: cron list should support agentId filtering in multi-agent setups

1 participant