Skip to content

fix(cron): deliver max-iteration fallback reports - #50980

Closed
helix4u wants to merge 1 commit into
NousResearch:mainfrom
helix4u:fix/cron-max-iteration-report-success
Closed

fix(cron): deliver max-iteration fallback reports#50980
helix4u wants to merge 1 commit into
NousResearch:mainfrom
helix4u:fix/cron-max-iteration-report-success

Conversation

@helix4u

@helix4u helix4u commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the cron-specific path where an agent reaches the iteration limit, produces a usable max-iteration fallback report, and then cron raises that report text as a runtime error because the generic agent result has completed=False.

The generic agent/finalizer semantics stay unchanged: max-iteration turns are still incomplete for interactive and worker paths. Cron now treats a non-empty max_iterations_reached(...) fallback response as deliverable output instead of turning the response into RuntimeError(<full report>).

This matches the support log shape from the thread: Turn ended: reason=max_iterations_reached(60/60) ... last_msg_role=assistant response_len=1707, immediately followed by cron raising the full generated price-check report.

Related Issue

Discord support thread: https://discord.com/channels/1053877538025386074/1518634271122784427

Related but separate PRs:

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • cron/scheduler.py: allow cron to deliver a non-empty max_iterations_reached(...) fallback response instead of raising it as an error when completed=False.
  • tests/cron/test_scheduler.py: add regression coverage for the fresh support-log shape.

How to Test

  1. Run the focused scheduler suite:
    scripts/run_tests.sh -j 4 tests/cron/test_scheduler.py
  2. Confirm max-iteration fallback summaries return success=True and include the report in cron output.
  3. Confirm real agent failure paths with failed=True, empty incomplete output, or explicit errors still fail.

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: WSL/Linux

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

For New Skills

N/A

Screenshots / Logs

Focused test run:

scripts/run_tests.sh -j 4 tests/cron/test_scheduler.py

Result: 163 tests passed.

@helix4u
helix4u marked this pull request as ready for review June 22, 2026 18:51
@helix4u

helix4u commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #50967. The cron fallback-summary fix from this PR has been moved onto #50967 so the support thread has one review target.

@helix4u helix4u closed this Jun 22, 2026
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.

1 participant