Skip to content

fix(cloud-agent-next): collect outcome health on the legacy 3-minute cron - #6953

Merged
eshurakov merged 1 commit into
mainfrom
eshurakov/tolerant-collection-cron
Sep 29, 2026
Merged

eshurakov merged 1 commit into
mainfrom
eshurakov/tolerant-collection-cron

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Problem

After #6906 deployed, Cloudflare kept firing the previous */3 trigger while the new scheduled() handler matched only */5. Every tick logged Cloud Agent scheduled handler received an unrecognized cron and ran no collection, so no agent_execution/agent_open rows were emitted and the pre-existing nested cloud_agent_outcome_aggregate stream stopped (~13:34Z).

Evidence from production: every scheduled invocation from 13:45Z through 14:06Z carries Event.Cron = "*/3 * * * *", with no invocation at the */5-only slots; the Cloudflare dashboard and the wrangler deploy log both show */5, and re-adding the trigger in the dashboard did not change the firing schedule.

Fix

Accept both expressions in scheduled(). The outcome window already floors controller.scheduledTime to 5-minute buckets, so an extra tick only re-emits a bucket, which the dashboard dedupes by windowStart.

This makes a stale trigger unable to silently disable collection. It does not resolve the underlying trigger/scheduler mismatch, which still needs Cloudflare-side reconciliation.

Checks

  • src/server.test.ts: 105 passed
  • pnpm run lint: 0 warnings, 0 errors
  • pnpm run format:check: clean
  • pnpm run typecheck (tsgo): clean

…cron

Cloudflare kept firing the previous `*/3` trigger after the deploy changed
it to `*/5`, and the handler's exact-string match meant the collector
silently stopped running while it logged an unrecognized cron.

Accept both expressions. The window already floors `scheduledTime` to
5-minute buckets, so an extra tick only repeats a bucket, which the
dashboard dedupes by `windowStart`.
@kilo-code-bot

kilo-code-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The change adds a OUTCOME_AGGREGATE_CRONS set so the scheduled handler also accepts the stale */3 trigger; the extra ticks only re-emit a 5-minute outcome bucket that the window already floors, and I found no correctness, security, or memory-leak issues in the changed lines.

Files Reviewed (2 files)
  • services/cloud-agent-next/src/server.ts
  • services/cloud-agent-next/src/server.test.ts

Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants