Skip to content

fix: default max_items to 1 at runtime to prevent unbounded batch fan-out#570

Merged
chubes4 merged 1 commit intomainfrom
fix/max-items-runtime-default
Mar 3, 2026
Merged

fix: default max_items to 1 at runtime to prevent unbounded batch fan-out#570
chubes4 merged 1 commit intomainfrom
fix/max-items-runtime-default

Conversation

@chubes4
Copy link
Member

@chubes4 chubes4 commented Mar 3, 2026

Summary

  • Fixes unbounded batch fan-out caused by max_items defaulting to 0 (unlimited) at runtime when flows lack a persisted value
  • Changes $config['max_items'] ?? 0$config['max_items'] ?? 1 in FetchHandler::get_fetch_data()

Problem

The FetchHandlerSettings UI defines 'default' => 1 for max_items, but that's only a form pre-fill hint — it's never applied when the field is absent from stored config. At runtime, ?? 0 meant unlimited.

Every Ticketmaster/Dice.fm/Reddit fetch returned ALL items, each fanning out into a child job with its own LLM call. Dice.fm Chicago alone returned 99 events → 99 child jobs. Across 46 parent batches, 309 child jobs were created with 261 stuck in processing, flooding the Action Scheduler queue with 331+ pending actions.

Fix

One-line change: runtime fallback matches the settings UI default. Flows that explicitly want batch fan-out must set max_items > 1 in the handler settings UI.

Already hotfixed on production — this PR formalizes the fix.

…-out

Existing flows lacked a persisted max_items value, causing the ?? 0
fallback (unlimited) to trigger. This led to hundreds of child jobs
from a single Ticketmaster/Dice.fm fetch, flooding the Action
Scheduler queue. The settings UI already defaulted to 1 but that
was only a form hint, never applied at runtime.
@chubes4 chubes4 merged commit 7d5c63c into main Mar 3, 2026
1 check failed
@chubes4 chubes4 deleted the fix/max-items-runtime-default branch March 3, 2026 22:41
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Homeboy Results — data-machine

lint (changed files only)

test

  • PHPCS: LINT SUMMARY: 212 errors, 199 warnings
  • Fixable: 176 | Files with issues: 108 of 346
Top violations
  WordPress.Arrays.ArrayDeclarationSpacing.ArrayItemNoNewLine    93
  WordPress.DB.PreparedSQL.NotPrepared                       55
  Generic.CodeAnalysis.UnusedFunctionParameter.Found         36
  Generic.Formatting.MultipleStatementAlignment.NotSameWarning    35
  WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned    35
- PHPStan: PHPSTAN SUMMARY: 152 errors at level 5 - BUILD FAILED: PHPUnit tests
Fatal error
Fatal:  Uncaught Error: Class "DataMachine\Engine\AI\System\Tasks\ImageGenerationTask" not found in /home/runner/work/data-machine/data-machine/tests/Unit/AI/System/Tasks/ImageGenerationTaskTest.php:13

audit


Homeboy Action v1 — homeboy 0.54.0

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