Skip to content

fix(dispatcher): tune recommender + poller timing defaults#123

Merged
thejustinwalsh merged 1 commit into
mainfrom
chore/tune-dispatch-defaults
May 24, 2026
Merged

fix(dispatcher): tune recommender + poller timing defaults#123
thejustinwalsh merged 1 commit into
mainfrom
chore/tune-dispatch-defaults

Conversation

@thejustinwalsh

@thejustinwalsh thejustinwalsh commented May 24, 2026

Copy link
Copy Markdown
Owner

Summary

Two hardcoded timing defaults were spec numbers that don't survive contact with a real repo. Dogfooding surfaced both.

Recommender agent cap: 5min → 15min (+ configurable)

A live mm run-recommender . timed out at the 5-min hard cap mid-run — the agent worked the full window ranking ~4 epics + ~15 issues and rewriting the schema-strict state issue without finishing, so #84 was never updated. Bumped the default to 15min and wired a [recommender] agent_timeout_minutes knob (config → recommender-run → workflow deps; the dep already existed, just was never plumbed).

Poller cadence: 60s → 120s (+ injectable)

The GitHub poller makes ~1 gh call per parked workflow per tick and has no rate-limit backoff (the spec's rate-limit cron was never built — #122). Safe at small scale, but no ceiling at many-parked / multi-repo, where secondary (burst) limits are the shadow-ban risk. A gentler default + injectable interval buys headroom; 2-min review-resume latency is fine for an autonomous loop.

Verification

Ran the new .middle/verify.toml gates (dogfooding them): format / lint --deny-warnings / typecheck clean; 482 tests pass.

Follow-up

Notes

Default bumps are conservative and behavior-preserving for correctness (only timing). The recommender knob defaults to undefined → workflow's 15-min default.

Summary by CodeRabbit

  • New Features

    • Recommender agents now support configurable timeout via agent_timeout_minutes setting in configuration
  • Changes

    • Default GitHub poller interval increased from 60 to 120 seconds
    • Default recommender agent hard timeout extended from 5 to 15 minutes

Review Change Stack

…orld use

The hardcoded 5-min recommender cap and 60s poller cadence were spec numbers that
don't hold up against a real repo / many parked workflows:

- Recommender agent cap: 5min → 15min default, and now configurable via
  [recommender] agent_timeout_minutes (plumbed config → recommender-run → workflow).
  The 5-min cap timed out mid-run ranking ~4 epics + ~15 issues against the
  schema-strict state issue.
- Poller cadence: 60s → 120s default, and the interval is now injectable on
  startPoller. ~1 gh call per parked workflow per tick with no backoff yet, so a
  gentler default keeps multi-repo / many-parked deployments clear of the 5000/hr
  ceiling and secondary burst limits. Proper rate-limit backoff is tracked in #122.
@thejustinwalsh thejustinwalsh added the dogfood Work dispatched through middle once dogfooding starts (phases 3+) label May 24, 2026
@coderabbitai

coderabbitai Bot commented May 24, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e571b44a-0092-48e9-b14a-c6cb12e941a3

📥 Commits

Reviewing files that changed from the base of the PR and between 9b5d8bc and 8db12e8.

📒 Files selected for processing (6)
  • packages/core/src/config.ts
  • packages/core/test/config.test.ts
  • packages/dispatcher/src/poller-cron.ts
  • packages/dispatcher/src/recommender-run.ts
  • packages/dispatcher/src/workflows/recommender.ts
  • packages/dispatcher/test/recommender-workflow.test.ts

📝 Walkthrough

Walkthrough

The PR introduces configurable timeouts for recommender agent workflows and makes the GitHub poller interval tunable. It adds an agentTimeoutMs field to the config, converts agent_timeout_minutes from TOML to milliseconds, threads the value through the dispatcher to the recommender workflow, and raises the default agent timeout from 5 to 15 minutes. The poller interval is similarly made configurable with a doubled default of 120,000ms.

Changes

Configuration and Tuning

Layer / File(s) Summary
Recommender agent timeout configuration
packages/core/src/config.ts, packages/core/test/config.test.ts
RecommenderSettings adds optional agentTimeoutMs field. mapRecommender converts numeric agent_timeout_minutes to milliseconds. Test fixture and assertion verify 20 minutes converts to 1,200,000 milliseconds.
Dispatcher recommender timeout wiring
packages/dispatcher/src/recommender-run.ts
DispatchRecommenderOptions includes optional agentTimeoutMs. Config value is threaded into runConfig during option resolution and forwarded as a parameter to createRecommenderWorkflow.
Workflow timeout constant and verification
packages/dispatcher/src/workflows/recommender.ts, packages/dispatcher/test/recommender-workflow.test.ts
Agent timeout constant increases from 5 to 15 minutes with expanded documentation. Test assertion updates to expect the new 15-minute default in the hard-cap timeout formula.
GitHub poller interval configurability
packages/dispatcher/src/poller-cron.ts
startPoller accepts optional intervalMs parameter (defaults to POLLER_INTERVAL_MS). Default constant increases from 60,000ms to 120,000ms. Cron scheduler uses the parameter instead of the fixed constant.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(dispatcher): tune recommender + poller timing defaults' accurately and concisely describes the main changes: adjusting timing defaults for both the recommender agent and the poller interval.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

dogfood Work dispatched through middle once dogfooding starts (phases 3+)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant