Skip to content

fix(cron): skip delivery for WebUI-origin cron jobs - #45392

Open
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/cron-webui-platform-delivery
Open

fix(cron): skip delivery for WebUI-origin cron jobs#45392
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/cron-webui-platform-delivery

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the unknown platform 'webui' delivery error for WebUI-origin cron jobs. When a cron job is created from the WebUI with deliver=origin, the saved origin platform is webui. The scheduler tried to resolve this via Platform("webui") which raised a ValueError, recording the error in last_delivery_error. Since WebUI surfaces cron runs by reading the local session DB, no external gateway delivery is needed — returning None (local-only) is the correct behavior.

Related Issue

Fixes #45360 (second part — unknown platform delivery error)

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • cron/scheduler.py: In _resolve_single_delivery_target(), when origin platform is "webui" (case-insensitive), return None instead of building a delivery target that would fail at Platform() resolution.
  • tests/cron/test_scheduler.py: Add 2 tests — test_webui_origin_platform_returns_none and test_webui_origin_platform_case_insensitive.

How to Test

  1. Create a cron job from the WebUI dashboard with deliver=origin
  2. Wait for the job to fire (or trigger manually)
  3. Verify last_delivery_error is not set to "unknown platform 'webui'"
  4. Verify the cron session is readable in WebUI as a normal chat transcript
  5. Run pytest tests/cron/test_scheduler.py::TestResolveDeliveryTarget -v — all tests pass

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Code Intelligence

  • Analyzed: _resolve_single_delivery_target (callers: _resolve_delivery_targets, flows: cron delivery pipeline)
  • Blast radius: LOW — single function, only affects delivery target resolution for "webui" origin platform
  • Related patterns: Platform._missing_() handles known plugin platforms but "webui" is not a registered plugin; the correct fix is to short-circuit before Platform resolution, not to register "webui" as a platform

WebUI reads cron run results from the local session DB, so
gateway delivery is unnecessary. When a WebUI-created job has
deliver=origin with platform=webui, return None (local-only)
instead of trying Platform("webui") which raises "unknown
platform 'webui'".

Fixes NousResearch#45360
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cron Cron scheduler and job management labels Jun 13, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

Clean, well-scoped fix. The change skips delivery for WebUI-origin cron jobs, preventing WebUI sessions from being surfaced as real cron delivery sessions.

  • Logic is correct and single-concern
  • No security concerns
  • No debug artifacts
  • Trivially correct fix with minimal diff

Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused fix. The reported path is still present on current main: cron/scheduler.py:1104-1110 turns any valid deliver=origin origin into a target, and cron/scheduler.py:1525-1530 then records unknown platform 'webui' when gateway Platform resolution fails. The proposed resolver short-circuit prevents that target from reaching gateway delivery, and the added lower-case and mixed-case tests cover its intended contract.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management P2 Medium — degraded but workaround exists sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cron WebUI runs can show prompt-only sessions and unknown platform 'webui' delivery errors

4 participants