fix(plugins): stop kanban dashboard nudge from exceeding max_in_progress - #81382
Open
fangliquanflq wants to merge 2 commits into
Open
fix(plugins): stop kanban dashboard nudge from exceeding max_in_progress#81382fangliquanflq wants to merge 2 commits into
fangliquanflq wants to merge 2 commits into
Conversation
Contributor
Author
|
CI flake note: slice 3 failed on unrelated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes the Kanban dashboard Nudge dispatcher path so it honors
kanban.max_in_progress(and per-profile caps). Previously a single UI nudge could push a board past the configured running limit (default nudge budget was 8) even when the gateway tick respected the cap.Symptom
Operators set
kanban.max_in_progress: 3, gateway logs show the cap loaded, but after a dashboard nudge the board can show ~8 tasks inrunning.Impact
Resource-constrained hosts / local models get more concurrent workers than configured, which can pile up timeouts, rate limits, and stalled capacity. Anyone using the dashboard nudge with
max_in_progressset is affected.Bug Cause
Trigger:
plugins/kanban/dashboard/plugin_api.pydispatch()- historicalmax_n: Query(8)passed only asmax_spawntodispatch_once.Causal chain:
POST /api/plugins/kanban/dispatch).dispatch_once(..., max_spawn=8)withmax_in_progress=None.dispatch_oncetreatsmax_spawnas a live concurrency budget (running + spawned), so the board can climb to ~8 running tasks.Why it is wrong:
max_spawnis not a substitute formax_in_progress. The board-wide / per-profile caps must be passed explicitly; omitting them means unlimited for those checks.Working sibling / contrast: Gateway watcher and
hermes kanban dispatchalready passmax_in_progress/max_in_progress_per_profilefrom config (#34337 for CLI).Ruled out: Config not loaded by the gateway - dispatcher logs showed
max_in_progress=3while the board still exceeded the cap after nudge-style bursts.Fix
Dashboard
/dispatchloads the same concurrency knobs from config as CLI/gateway.?max=only overridesmax_spawn(including0= spawn nothing this tick); it does not bypassmax_in_progress. Negativemaxreturns 422.Related Issue
Fixes #81381
Type of Change
Changes Made
plugins/kanban/dashboard/plugin_api.py- passmax_in_progress,max_in_progress_per_profile,default_assignee, and configmax_spawnintodispatch_once; stop defaulting nudgemaxto 8tests/plugins/test_kanban_dashboard_plugin.py- regression coverage for config passthrough,?max=override, andmax=0How to Test
python -m pytest tests/plugins/test_kanban_dashboard_plugin.py -k test_dispatch -qkanban.max_in_progress: 3, put 5+ ready tasks on a board, callPOST /api/plugins/kanban/dispatch, confirm running count does not exceed 3.?max=0and confirm no new spawns while the cap args still arrive.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) - N/A (docstring on the endpoint only)cli-config.yaml.exampleif I added/changed config keys - N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows - N/A