# The factory manufactured its own CI queue. Seva Brekelov · [Building an AI factory](index.html) · 5 of 6 One day produced 175 branch refreshes. On the next, 18 of 20 task sessions were idle while their Stop hooks waited for checks. On 26 November, Hivemill refreshed branches 175 times. Two tasks had their branches refreshed 17 times each. Each refresh started a new CI run and cancelled the one in flight. The runner treated a cancellation like a failed check and woke a session to fix a pull request that might have been fine. We changed the decision about when to refresh. The runner waits for a green result before refreshing a head and gives each repository one refresh slot. A cancelled check stays pending. A shared changelog edit also stopped counting as evidence that two changes overlapped. The next day, a different wait left 18 of 20 task sessions idle. A Stop hook was holding a session open while a local CI job waited in a queue. The hook could hit its 30-minute timeout without producing a decision. We changed it to enqueue the work and return. The merge step still requires a green result on the exact commit being merged. The two changes answer different questions: when should the factory create another CI run, and who needs to wait for it? The pull requests record the fixes and their checks. I’d want a later sample of refreshes per merge and time spent waiting before claiming a sustained throughput gain. ## Sources Changes and incident counts are documented in pull requests #1068 and #1136. - [Branch refresh fix · PR #1068](https://github.com/volekerb/hivemill/pull/1068) - [Stop hook fix · PR #1136](https://github.com/volekerb/hivemill/pull/1136)