Repository navigation
[3479 by Claude Opus 5.5] Defer jobs whose agent is at its ceiling instead of holding a worker, and charge the actual direct agent - #3497
Conversation
…had already finished. No test failed because of this change, so my earlier summary stands.
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds early capacity checks, queue deferral, synthetic-member selection, and timeline reporting across the main job types. It needs changes before merge because the new pre-check can prevent recovery of abandoned capacity holders. ✅ Preserved retry budget — Deferrals use ✅ Separated capacity failures — Provider replacement and synthetic failover explicitly exclude capacity refusals. ✅ Useful waiting state — Repeated deferrals update one timeline entry with aliases, count, and retry time. The supplied current-head status has no failures and five pending checks. This review is static; no commands or tests were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Allow abandoned holders to reach recovery
SuggestionsThese are optional follow-ups and are not sent to No suggestions. ScoreThe implementation has substantial coverage and clear integration across job types, but the abandoned-holder recovery regression can indefinitely stall an alias. Correct that path before merge and confirm the pending checks complete successfully. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 2cf21c7
Summary of ChangesI fixed F1: a job whose agent's holder died is no longer deferred forever. It now gets through to admission, which recovers the dead holder and then runs the job. Cause. The capacity pre-check counted every holder record for the alias. A holder whose lease had expired, or one already marked Fix (in
New test in
With the old pre-check put back, this test fails while the other five in the file pass. Verification:
One unrelated flaky test: in one of three There's no visual preview because nothing in the UI changed. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ferred forever. It now gets through to admission, which recovers the dead holder and then runs the job. I fixed F1: a job whose agent's holder died is no longer deferred forever. It now gets through to admission, which recovers the dead holder and then runs the job. **Cause.** The capacity pre-check counted every holder record for the alias. A holder whose lease had expired, or one already marked `recovering`, still counted, so every job for that alias was deferred before it reached the admission loop. That loop is the only place recovery runs, so nothing could ever free the slot. **Fix** (in `packages/core/src/agents/agentCapacity.ts`): - **New read-only helper.** `agentAdmissionAliasOccupancy` splits each alias's holders into `live` and `recoverable` (lease expired, or `recovering`). It uses Redis server time, the same clock the admission script uses to expire leases. - **Pre-check counts only live holders.** If a job only meets recoverable holders, it goes on to the normal acquire. That calls `recover`, which removes the recorded container before releasing the holder, so a slot is still never reused until removal is confirmed. If removal fails, the slot stays held, as before. - **The two other callers get the same rule.** Synthetic routing goes through the same pre-check. The wake-up on release (`wakeAgentCapacityWaiters`) now counts only live holders when working out free slots, so a woken job can be the one that does the recovery. - **No change to the admission script.** `agentRunAdmission.ts` is untouched; I moved the helper out of it because it pushed the file over the 400-line lint limit. - **Docs.** `docs/docs/architecture/agent-run-admission.md` now explains the live-holder rule for the pre-check and the wake-up. **New test** in `test/agentCapacityDeferral.test.ts`, run against a real Redis 7.4.1 and BullMQ: 1. A holder on a ceiling-1 alias "dies": its lease renewal never completes and it never calls `finish()`. 2. A job for that alias is deferred while the holder is still live, and the wake-up finds no free slot. 3. After the lease expires, the holder record is still there, but the pre-check reports room and the wake-up promotes the waiting job. 4. The job runs. The dead container is removed before the job's own container is created, it used one attempt, and its deferral data is cleared. 5. A later job for the same alias runs without being deferred, and no holder records are left. With the old pre-check put back, this test fails while the other five in the file pass. **Verification:** - `agentCapacityDeferral` passed 6/6 three times in a row. - Related suites pass: `agentRunAliasAdmission` (10), `agentRunAdmission` (27), `reviewCapacityRouting` (2), and core's `syntheticRoutingCapacity` and `syntheticRoutingService` (19). - Typecheck (root and core) and `eslint --max-warnings 0` on the core agents directory are clean. One unrelated flaky test: in one of three `agentRunAdmission` runs, "caller deadline during create removes the ID without starting it" timed out at 15 s. It forks worker processes, doesn't depend on any file I changed, and passed 4 more times in a row both with and without this fix. There's no visual preview because nothing in the UI changed. PR: #3497 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
⏳ Ultrafix is waiting for CI before the next These blocking checks on
Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops. |
|
CI failed: Full Test Suite Shard 1/4 Please investigate and fix this CI failure.
Failure evidence
|
|
🔄 Starting work on follow-up changes requested by @propr-dev[bot] I'll analyze the 1 request and implement the necessary changes. Processing comment ID: 6830744846✓ |
AI Implementation Summary
Closes #3479
Branch:
3479/claude-opus-5-5-defer-jobs-whose-agent-is-20261112-1539-3bsCommits: ✅ Changes committed (0cfaca1)
AI Processing Completed
Execution Details:
Summary:
The monitor only expired; it doesn't need re-arming, since the batch had already finished. No test failed because of this change, so my earlier summary stands.
Detailed Logs:
ddd90f9b-7015-4a78-9bce-df6651bb8687Log files stored at:
/usr/src/app/logs/executions/issue-3479-2026-11-12T16-41-13-936Z-conversation.json/usr/src/app/logs/executions/issue-3479-2026-11-12T16-41-13-936Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #3479.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!
Visual preview
Waiting for Agent Capacity timeline row
Task details at 1440px for an issue deferred four times because its direct agent local-llama is at its per-agent ceiling: one waiting row, updated in place, with the alias, the deferral count and the next retry time
Connect sign-in required. Original retained until 2027-02-10T16:41:19.293Z.
View the full-resolution original in ProPR Connect