MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / _warm

Function _warm

src/deferred_init.py:67–85  ·  view source on GitHub ↗
(cwd: str | None, include_system_context: bool)

Source from the content-addressed store, hash-verified

65
66
67async def _warm(cwd: str | None, include_system_context: bool) -> None:
68 # The whole body is guarded: in loop mode a failure outside the
69 # gather (e.g. the import) would otherwise surface as an unretrieved
70 # task exception — prefetching is advisory and must never propagate.
71 try:
72 from src.context_system.prompt_assembly import (
73 get_system_context,
74 get_user_context,
75 )
76
77 coros = [get_user_context(cwd)]
78 if include_system_context:
79 coros.append(get_system_context(cwd))
80 results = await asyncio.gather(*coros, return_exceptions=True)
81 for result in results:
82 if isinstance(result, Exception):
83 logger.debug("deferred prefetch lane failed: %r", result)
84 except Exception as exc:
85 logger.debug("deferred prefetch failed: %r", exc)
86
87
88def start_deferred_prefetches(

Callers 2

_run_in_threadFunction · 0.85

Calls 3

get_user_contextFunction · 0.90
get_system_contextFunction · 0.90
appendMethod · 0.45

Tested by

no test coverage detected