flock-core 0.4.508__py3-none-any.whl → 0.4.509__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of flock-core might be problematic. Click here for more details.

flock/webapp/app/main.py CHANGED
@@ -24,6 +24,7 @@ from fastapi.responses import HTMLResponse, RedirectResponse
24
24
  from fastapi.staticfiles import StaticFiles
25
25
  from fastapi.templating import Jinja2Templates
26
26
  from pydantic import BaseModel
27
+ from typing import Any
27
28
 
28
29
  from flock.core.api.endpoints import create_api_router
29
30
  from flock.core.api.run_store import RunStore
@@ -147,23 +148,30 @@ async def lifespan(app: FastAPI):
147
148
  set_global_shared_link_store(shared_link_store)
148
149
  logger.info("SharedLinkStore initialized and set globally.")
149
150
  except Exception as e:
150
- logger.error(f"Failed to initialize SharedLinkStore: {e}", exc_info=True)
151
-
152
- # Configure chat features based on environment variables
153
- # These are typically set by __init__.py when launching with --chat or --web --chat
154
- flock_start_mode = os.environ.get("FLOCK_START_MODE")
155
- flock_chat_enabled_env = os.environ.get("FLOCK_CHAT_ENABLED", "false").lower() == "true"
156
-
157
- should_enable_chat_routes = False
158
- if flock_start_mode == "chat":
151
+ logger.error(f"Failed to initialize SharedLinkStore: {e}", exc_info=True) # Configure chat features with clear precedence:
152
+ # 1. Value set by start_unified_server (programmatic)
153
+ # 2. Environment variables (standalone mode)
154
+ programmatic_chat_enabled = getattr(app.state, "chat_enabled", None)
155
+ env_start_mode = os.environ.get("FLOCK_START_MODE")
156
+ env_chat_enabled = os.environ.get("FLOCK_CHAT_ENABLED", "false").lower() == "true"
157
+
158
+ if programmatic_chat_enabled is not None:
159
+ # Programmatic setting takes precedence (from start_unified_server)
160
+ should_enable_chat_routes = programmatic_chat_enabled
161
+ logger.info(f"Using programmatic chat_enabled setting: {should_enable_chat_routes}")
162
+ elif env_start_mode == "chat":
159
163
  should_enable_chat_routes = True
160
- app.state.initial_redirect_to_chat = True # Signal dashboard to redirect
161
- logger.info("FLOCK_START_MODE='chat'. Chat routes will be enabled and initial redirect to chat is set.")
162
- elif flock_chat_enabled_env:
164
+ app.state.initial_redirect_to_chat = True
165
+ app.state.chat_enabled = True
166
+ logger.info("FLOCK_START_MODE='chat'. Enabling chat routes and setting redirect.")
167
+ elif env_chat_enabled:
163
168
  should_enable_chat_routes = True
164
- logger.info("FLOCK_CHAT_ENABLED='true'. Chat routes will be enabled.")
165
-
166
- app.state.chat_enabled = should_enable_chat_routes # For context in templates
169
+ app.state.chat_enabled = True
170
+ logger.info("FLOCK_CHAT_ENABLED='true'. Enabling chat routes.")
171
+ else:
172
+ should_enable_chat_routes = False
173
+ app.state.chat_enabled = False
174
+ logger.info("Chat routes disabled (no programmatic or environment setting).")
167
175
 
168
176
  if should_enable_chat_routes:
169
177
  try:
@@ -171,10 +179,8 @@ async def lifespan(app: FastAPI):
171
179
  app.include_router(chat_router, tags=["Chat"])
172
180
  logger.info("Chat routes included in the application.")
173
181
  except Exception as e:
174
- logger.error(f"Failed to include chat routes during lifespan startup: {e}", exc_info=True)
175
-
176
- # If in standalone chat mode, strip non-essential UI routes
177
- if flock_start_mode == "chat":
182
+ logger.error(f"Failed to include chat routes during lifespan startup: {e}", exc_info=True) # If in standalone chat mode, strip non-essential UI routes
183
+ if env_start_mode == "chat":
178
184
  from fastapi.routing import APIRoute
179
185
  logger.info("FLOCK_START_MODE='chat'. Stripping non-chat UI routes.")
180
186
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flock-core
3
- Version: 0.4.508
3
+ Version: 0.4.509
4
4
  Summary: Declarative LLM Orchestration at Scale
5
5
  Author-email: Andre Ratzenberger <andre.ratzenberger@whiteduck.de>
6
6
  License-File: LICENSE
@@ -489,7 +489,7 @@ flock/webapp/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
489
489
  flock/webapp/app/chat.py,sha256=d5a_mr3H2nuWNFSpSlI_HyqX-J_4krndd4A-8S25EKM,28679
490
490
  flock/webapp/app/config.py,sha256=lqmneujnNZk-EFJV5cWpvxkqisxH3T3zT_YOI0JYThE,4809
491
491
  flock/webapp/app/dependencies.py,sha256=JUcwY1N6SZplU141lMN2wk9dOC9er5HCedrKTJN9wJk,5533
492
- flock/webapp/app/main.py,sha256=n5cTAFyuLXayolYAN_UnmiMAKoEE6_G4tmfSEc0Poog,53807
492
+ flock/webapp/app/main.py,sha256=g3kjtzJOC0UzWBBT4D9KyBKJxQWM1TkxHgsDaFqNuGs,54247
493
493
  flock/webapp/app/models_ui.py,sha256=vrEBLbhEp6FziAgBSFOLT1M7ckwadsTdT7qus5_NduE,329
494
494
  flock/webapp/app/theme_mapper.py,sha256=QzWwLWpED78oYp3FjZ9zxv1KxCyj43m8MZ0fhfzz37w,34302
495
495
  flock/webapp/app/utils.py,sha256=RF8DMKKAj1XPmm4txUdo2OdswI1ATQ7cqUm6G9JFDzA,2942
@@ -554,8 +554,8 @@ flock/workflow/agent_execution_activity.py,sha256=Gy6FtuVAjf0NiUXmC3syS2eJpNQF4R
554
554
  flock/workflow/flock_workflow.py,sha256=iSUF_soFvWar0ffpkzE4irkDZRx0p4HnwmEBi_Ne2sY,9666
555
555
  flock/workflow/temporal_config.py,sha256=3_8O7SDEjMsSMXsWJBfnb6XTp0TFaz39uyzSlMTSF_I,3988
556
556
  flock/workflow/temporal_setup.py,sha256=YIHnSBntzOchHfMSh8hoLeNXrz3B1UbR14YrR6soM7A,1606
557
- flock_core-0.4.508.dist-info/METADATA,sha256=_THooyyskEuH1CU8OfPv_CcHecZ1lEtSTFjeoOS5Q24,22584
558
- flock_core-0.4.508.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
559
- flock_core-0.4.508.dist-info/entry_points.txt,sha256=rWaS5KSpkTmWySURGFZk6PhbJ87TmvcFQDi2uzjlagQ,37
560
- flock_core-0.4.508.dist-info/licenses/LICENSE,sha256=iYEqWy0wjULzM9GAERaybP4LBiPeu7Z1NEliLUdJKSc,1072
561
- flock_core-0.4.508.dist-info/RECORD,,
557
+ flock_core-0.4.509.dist-info/METADATA,sha256=NI5RWK5HlQZIAxaid8PmUmx-liIfeP64Zg1ptSbEyC4,22584
558
+ flock_core-0.4.509.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
559
+ flock_core-0.4.509.dist-info/entry_points.txt,sha256=rWaS5KSpkTmWySURGFZk6PhbJ87TmvcFQDi2uzjlagQ,37
560
+ flock_core-0.4.509.dist-info/licenses/LICENSE,sha256=iYEqWy0wjULzM9GAERaybP4LBiPeu7Z1NEliLUdJKSc,1072
561
+ flock_core-0.4.509.dist-info/RECORD,,