Skip to content

Remove agent evaluation concurrency limits and skip same-day re-evaluation - #132

Merged
xrendan merged 2 commits into
mainfrom
fix/agent-evaluate-concurrency-and-same-day-guard
Sep 10, 2026
Merged

Remove agent evaluation concurrency limits and skip same-day re-evaluation#132
xrendan merged 2 commits into
mainfrom
fix/agent-evaluate-concurrency-and-same-day-guard

Conversation

@xrendan

@xrendan xrendan commented Sep 10, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #131, for AgentEvaluateCommitmentJob:

  • Weekly scan silently dropped commitments — the job had enqueue_limit: 550, but the scan enqueues ~600. GoodJob drops enqueues past the limit without error, so up to ~50 commitments were never evaluated on Sundays.
  • Concurrency control removed entirely — with the enqueue limit gone and perform_limit also dropped, the GoodJob concurrency extension had nothing left to enforce. The include, the good_job_control_concurrency_with block, and the ConcurrencyExceededError retry handler are gone. Concurrency is now bounded by the worker thread count (good_job.max_threads, currently 5).
  • Same-day re-evaluation guard — each evaluation is a ~2 minute agent session. The job now skips a commitment whose last_assessed_at is today unless called with force: true, so a re-run of the scan or a duplicate manual enqueue doesn't repeat work.
AgentEvaluateCommitmentJob.perform_now(commitment)               # skips if assessed today
AgentEvaluateCommitmentJob.perform_now(commitment, force: true)  # always runs

Notes

  • A full sweep at 5 threads is roughly 4.5 hours. Raising max_threads is the lever to shorten it.
  • During a sweep, agent sessions can occupy every worker thread, so feed refreshes and entry jobs queue behind them. A dedicated queue for agent jobs would be the clean fix if that becomes a problem.

Testing

  • bin/rubocop — no offenses
  • New tests: same-day skip, forced re-run, previous-day run

- Remove enqueue_limit: 550 from AgentEvaluateCommitmentJob; the weekly
  scan enqueues ~600 commitments and GoodJob silently dropped the excess
- Skip commitments whose last_assessed_at is today unless force: true, so
  a re-run of the scan or a duplicate manual enqueue doesn't repeat a
  ~2 minute agent session
With enqueue_limit gone and perform_limit removed there is nothing left for
the extension to enforce; concurrency is bounded by the worker thread count.
@xrendan
xrendan merged commit 17427a8 into main Sep 10, 2026
3 checks passed
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