6464 validate_plugin_cache_hooks ,
6565)
6666from autoskillit .pipeline import create_background_task
67+ from autoskillit .server ._guards import _backend_supports_quota
6768from autoskillit .server ._state import _get_ctx_or_none , deferred_initialize
6869
6970logger = get_logger (__name__ )
@@ -253,7 +254,6 @@ async def _fleet_auto_gate_boot(ctx: Any) -> None:
253254 from autoskillit .server ._misc import ( # circular-break
254255 _prime_quota_cache ,
255256 _quota_refresh_loop ,
256- resolve_provider ,
257257 )
258258 from autoskillit .server .tools .tools_kitchen import _write_hook_config # circular-break
259259
@@ -269,16 +269,18 @@ async def _fleet_auto_gate_boot(ctx: Any) -> None:
269269 except Exception :
270270 logger .warning ("fleet_auto_gate_boot_write_hook_config_failed" , exc_info = True )
271271
272+ _supports_quota = _backend_supports_quota (ctx )
273+
272274 try :
273- await _prime_quota_cache ()
275+ await _prime_quota_cache (supports_quota_check = _supports_quota )
274276 except Exception :
275277 logger .warning ("fleet_auto_gate_boot_prime_quota_cache_failed" , exc_info = True )
276278
277279 try :
278280 ctx .quota_refresh_task = create_background_task (
279281 _quota_refresh_loop (
280282 ctx .config .quota_guard ,
281- provider = resolve_provider ( ctx . config . providers . default_provider ) ,
283+ supports_quota_check = _supports_quota ,
282284 ),
283285 label = "quota_refresh_loop" ,
284286 )
@@ -341,7 +343,8 @@ async def _pre_reveal_kitchen(ctx: Any) -> None:
341343 _mcp .disable (tags = {tag })
342344 register_active_kitchen (ctx .kitchen_id , os .getpid (), str (ctx .project_dir ))
343345 _write_hook_config ()
344- await _prime_quota_cache ()
346+ _supports_quota = _backend_supports_quota (ctx )
347+ await _prime_quota_cache (supports_quota_check = _supports_quota )
345348 ctx .gate_infrastructure_ready = True
346349
347350
@@ -355,7 +358,6 @@ async def _food_truck_auto_gate_boot(ctx: Any) -> None:
355358 from autoskillit .server ._misc import ( # circular-break
356359 _prime_quota_cache ,
357360 _quota_refresh_loop ,
358- resolve_provider ,
359361 )
360362 from autoskillit .server .tools .tools_kitchen import _write_hook_config # circular-break
361363
@@ -401,8 +403,10 @@ async def _food_truck_auto_gate_boot(ctx: Any) -> None:
401403 except Exception :
402404 logger .warning ("food_truck_auto_gate_boot_hook_config_failed" , exc_info = True )
403405
406+ _supports_quota = _backend_supports_quota (ctx )
407+
404408 try :
405- await _prime_quota_cache ()
409+ await _prime_quota_cache (supports_quota_check = _supports_quota )
406410 except Exception :
407411 logger .warning ("food_truck_auto_gate_boot_quota_cache_failed" , exc_info = True )
408412
@@ -411,7 +415,7 @@ async def _food_truck_auto_gate_boot(ctx: Any) -> None:
411415 ctx .quota_refresh_task = create_background_task (
412416 _quota_refresh_loop (
413417 ctx .config .quota_guard ,
414- provider = resolve_provider ( ctx . config . providers . default_provider ) ,
418+ supports_quota_check = _supports_quota ,
415419 ),
416420 label = "quota_refresh_loop" ,
417421 )
@@ -514,7 +518,8 @@ async def _skill_auto_gate_boot(ctx: Any) -> None:
514518 try :
515519 from autoskillit .server ._misc import _prime_quota_cache # circular-break
516520
517- await _prime_quota_cache ()
521+ _supports_quota = _backend_supports_quota (ctx )
522+ await _prime_quota_cache (supports_quota_check = _supports_quota )
518523 except Exception :
519524 logger .warning ("skill_auto_gate_boot_quota_cache_failed" , exc_info = True )
520525
0 commit comments