TheRealAIGuy commited on
Commit
d65f1eb
·
verified ·
1 Parent(s): 2984148

Lambda Singleton Fix

Browse files
Files changed (1) hide show
  1. server/app.py +2 -4
server/app.py CHANGED
@@ -44,9 +44,6 @@ except ImportError as e:
44
  # PHASE 2: SYSTEM STATE & AUTHORITY TRACKING
45
  # ==============================================================================
46
 
47
- # FIX: Global pointer to capture the OpenEnv-managed instance
48
- active_env_instance = None
49
-
50
  if HAS_ENV and NATIVE_VERIFIED:
51
  class TrackedFinAuditorEnvironment(FinAuditorEnvironment):
52
  """Wrapper class to capture the environment instance created by OpenEnv"""
@@ -56,7 +53,8 @@ if HAS_ENV and NATIVE_VERIFIED:
56
  active_env_instance = self
57
 
58
  # OpenEnv creates the FastAPI app and instantiates TrackedFinAuditorEnvironment internally
59
- app = create_app(TrackedFinAuditorEnvironment, AuditorAction, AuditorObservation)
 
60
  else:
61
  app = FastAPI(title="PayGorn (MOCK MODE)")
62
  @app.post("/reset")
 
44
  # PHASE 2: SYSTEM STATE & AUTHORITY TRACKING
45
  # ==============================================================================
46
 
 
 
 
47
  if HAS_ENV and NATIVE_VERIFIED:
48
  class TrackedFinAuditorEnvironment(FinAuditorEnvironment):
49
  """Wrapper class to capture the environment instance created by OpenEnv"""
 
53
  active_env_instance = self
54
 
55
  # OpenEnv creates the FastAPI app and instantiates TrackedFinAuditorEnvironment internally
56
+ active_env_instance = FinAuditorEnvironment()
57
+ app = create_app(lambda: active_env_instance, AuditorAction, AuditorObservation)
58
  else:
59
  app = FastAPI(title="PayGorn (MOCK MODE)")
60
  @app.post("/reset")