mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-25 00:45:54 +03:00
[PR #434] Add startup readiness checks and authenticated tenant readiness endpoint #738
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#738
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AJaySi/ALwrity/pull/434
Author: @AJaySi
Created: 3/12/2026
Status: 🔄 Open
Base:
main← Head:codex/improve-startup-health-checks-and-readiness-signals📝 Commits (1)
593110bAdd startup readiness checks and tenant auth-context health endpoint📊 Changes
4 files changed (+325 additions, -14 deletions)
View changed files
📝
backend/app.py(+22 -6)📝
backend/main.py(+24 -8)➕
backend/services/startup_health.py(+214 -0)➕
docs/STARTUP_READINESS_BEHAVIOR.md(+65 -0)📄 Description
Motivation
init_database()as the sole readiness signal so startup validates filesystem and tenant DBs in multi-tenant mode.Description
backend/services/startup_health.pythat verifies the workspace root exists and is writable, validates DB open/create for single-tenant or a tenant (or synthetic) path in multi-tenant, and performs required schema/table+column compatibility checks for baseline migrations using_REQUIRED_SCHEMA(e.g.,onboarding_sessions,daily_workflow_plans).init_database()as the primary readiness signal in bothbackend/main.pyandbackend/app.pyby callingrun_startup_health_routine()during application startup and logging errors explicitly, and re-raising to enable fail-fast behavior when configured.GET /health/readiness(in both entrypoints) that returns the latest startup report viaget_startup_status()and a per-tenant auth-context check viareadiness_under_auth_context()which resolves the tenant DB path and attempts a session/query.docs/STARTUP_READINESS_BEHAVIOR.mddescribing single-tenant vs multi-tenant expectations, warning vs failure conditions, and theALWRITY_FAIL_FAST_STARTUP/ production default semantics.Testing
python -m py_compile backend/services/startup_health.py backend/main.py backend/app.pywhich succeeded.run_startup_health_routine()which exercised DB initialization paths and reported afailedstatus in this environment due to the workspace root not existing (this is environment-dependent and expected in a clean test container); the routine logged errors and warnings as designed.run_startup_health_routine().Codex Task
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.