feat(services): enhance services with rollback and observability
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
25
backend/app/services/rollback_controller.py
Normal file
25
backend/app/services/rollback_controller.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from app.config import settings
|
||||
|
||||
|
||||
FEATURE_FLAG_NAMES = (
|
||||
"ENABLE_RETROSPECTIVE",
|
||||
"ENABLE_SESSION_RETROSPECTIVE_SEARCH",
|
||||
"ENABLE_RUNTIME_SKILL_SHORTLIST",
|
||||
"ENABLE_LEARNING_SIGNALS",
|
||||
"ENABLE_SKILL_PROMOTION",
|
||||
"ENABLE_LEARNED_SKILL_LOADING",
|
||||
"ENABLE_PARALLEL_TASK_GRAPH",
|
||||
)
|
||||
|
||||
|
||||
class RollbackController:
|
||||
def snapshot_flags(self) -> dict[str, bool]:
|
||||
return {
|
||||
flag_name: bool(getattr(settings, flag_name, False))
|
||||
for flag_name in FEATURE_FLAG_NAMES
|
||||
}
|
||||
|
||||
def is_enabled(self, flag_name: str) -> bool:
|
||||
return bool(getattr(settings, flag_name, False))
|
||||
Reference in New Issue
Block a user