MCPcopy Create free account
hub / github.com/MemTensor/MemOS / wrapper

Method wrapper

src/memos/context/context.py:262–275  ·  view source on GitHub ↗
(*args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

260
261 @functools.wraps(fn)
262 def wrapper(*args: Any, **kwargs: Any) -> Any:
263 if main_context:
264 # Create and set new context in worker thread
265 child_context = RequestContext(
266 trace_id=main_trace_id,
267 api_path=main_api_path,
268 env=main_env,
269 user_type=main_user_type,
270 user_name=main_user_name,
271 )
272 child_context._data = main_context._data.copy()
273 set_request_context(child_context)
274
275 return fn(*args, **kwargs)
276
277 return super().submit(wrapper, *args, **kwargs)
278

Callers

nothing calls this directly

Calls 3

RequestContextClass · 0.85
set_request_contextFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected