Skip to content

Cron: route reminders by session namespace#18637

Merged
steipete merged 5 commits intomainfrom
codex/cron-session-scoped-reminders-clean
Feb 17, 2026
Merged

Cron: route reminders by session namespace#18637
steipete merged 5 commits intomainfrom
codex/cron-session-scoped-reminders-clean

Conversation

@vignesh07
Copy link
Contributor

@vignesh07 vignesh07 commented Feb 16, 2026

Summary

  • add sessionKey support to cron job types/schemas/normalization/store migration
  • stamp cron jobs created from tool calls with caller sessionKey (without overriding explicit values)
  • propagate sessionKey through cron main-session execution (enqueueSystemEvent, runHeartbeatOnce, requestHeartbeatNow)
  • carry wake targets (agentId, sessionKey) through heartbeat wake queue/retries and targeted heartbeat runner execution
  • dedupe gateway cron wake target resolution in a helper
  • regenerate protocol Swift models for cron sessionKey additions

Validation

  • pnpm protocol:check
  • pnpm check
  • pnpm exec vitest run --config vitest.e2e.config.ts src/agents/tools/cron-tool.e2e.test.ts src/gateway/server.cron.e2e.test.ts

Greptile Summary

This PR adds sessionKey support to the cron system to enable session-specific routing of reminders and wake events. The implementation threads sessionKey through the entire cron execution pipeline: from job creation (via tool calls), through storage and normalization, to heartbeat execution and wake event targeting.

Key changes:

  • Added sessionKey field to CronJob type and protocol schemas
  • Updated cron tool to stamp jobs with caller sessionKey when not explicitly provided
  • Propagated sessionKey through enqueueSystemEvent, runHeartbeatOnce, and requestHeartbeatNow
  • Enhanced heartbeat wake queue to carry and preserve agentId + sessionKey across retries
  • Added targeted heartbeat runner execution that routes to specific agent/session combinations
  • Deduped gateway cron wake target resolution logic into helper functions
  • Regenerated Swift protocol models for macOS/iOS apps

Testing:
The PR includes comprehensive test coverage for the new functionality including e2e tests for sessionKey stamping, wake target routing, and retry preservation.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is thorough, well-tested, and follows existing patterns. All changes are additive (new optional field) with proper backward compatibility. The sessionKey field is normalized, validated, and propagated consistently throughout the codebase. Comprehensive test coverage includes e2e tests, unit tests for normalization, wake queue routing, and store migration. The PR includes protocol regeneration for Swift models maintaining cross-platform consistency.
  • No files require special attention

Last reviewed commit: a42b2a2

@openclaw-barnacle openclaw-barnacle bot added app: macos App: macos app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling labels Feb 16, 2026
@openclaw-barnacle openclaw-barnacle bot added size: L maintainer Maintainer-authored PR labels Feb 16, 2026
@openclaw openclaw deleted a comment from github-actions bot Feb 16, 2026
@steipete steipete closed this Feb 16, 2026
@vignesh07
Copy link
Contributor Author

Addressed blocker regression in targeted wake coalescing.

Changes:

  • switched pending wake storage from a single slot to per-target entries keyed by (agentId, sessionKey) in src/infra/heartbeat-wake.ts
  • timer tick now drains all pending targets (sequentially) instead of consuming only one
  • retry requeue now preserves per-target wake identity
  • added regression test in src/infra/heartbeat-wake.test.ts that enqueues two distinct targeted wakes in the same coalescing window and asserts both execute

Validation:

  • pnpm test src/infra/heartbeat-wake.test.ts src/infra/heartbeat-runner.scheduler.test.ts
  • pnpm check
  • pnpm protocol:check

@steipete steipete reopened this Feb 16, 2026
@github-actions
Copy link
Contributor

⚠️ Formal models conformance drift detected

The formal models extracted constants (generated/*) do not match this openclaw PR.

This check is informational (not blocking merges yet).
See the formal-models-conformance-drift artifact for the diff.

If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there.

@steipete steipete self-assigned this Feb 16, 2026
@gumadeiras
Copy link
Member

you might want to add "sessionKey" to the JOB_KEYS allowlist for when reconstructing params.job and add a regression test for where action: add uses top level sessionkey (not nested job) and assert that the sessionKey is passed correctly

will test it!

@steipete steipete merged commit c20ef58 into main Feb 17, 2026
10 checks passed
@steipete steipete deleted the codex/cron-session-scoped-reminders-clean branch February 17, 2026 00:55
@steipete
Copy link
Contributor

Landed via temp rebase onto main.

  • Gate: pnpm check (fails due existing repo-wide formatting drift), pnpm build, pnpm test, pnpm docs:list
  • Land commit: 4e930db
  • Merge commit: c20ef58

Thanks @vignesh07!

@github-actions
Copy link
Contributor

⚠️ Formal models conformance drift detected

The formal models extracted constants (generated/*) do not match this openclaw PR.

This check is informational (not blocking merges yet).
See the formal-models-conformance-drift artifact for the diff.

If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there.

archerhpagent pushed a commit to howardpark/openclaw that referenced this pull request Feb 18, 2026
jun-planfit pushed a commit to planfit/openclaw that referenced this pull request Feb 19, 2026
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
(cherry picked from commit c20ef58)

# Conflicts:
#	CHANGELOG.md
#	src/agents/tools/cron-tool.ts
#	src/gateway/server-cron.ts
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
(cherry picked from commit c20ef58)

# Conflicts:
#	CHANGELOG.md
#	src/agents/tools/cron-tool.ts
#	src/gateway/server-cron.ts
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
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 gateway Gateway runtime maintainer Maintainer-authored PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants