- Remove 'start_cache_sync' from rbac.init import
- Remove 'add_startup' import
- Remove 'add_startup(start_cache_sync)' call from init()
- This reverts the cache_sync integration that caused session data loss
- init() is called synchronously before the event loop starts
(configuredServer.py:36), so asyncio.create_task() fails with
'no running event loop'
- Use ahserver's add_startup() which appends to app.on_startup
and runs after the loop is ready (configuredServer.py:118)
- Remove unused asyncio import
Added logined permission entries for all v1 OpenAI-compatible endpoints:
- /v1/chat/completions (existing, was missing)
- /v1/models (existing, was missing)
- /v1/tasks (existing, was missing)
- /v1/video/generations (new)
- /v1/image/generations (new)
Each has both directory and index.dspy file entries.
- Extract backend_accounting from llmage cleanupctx to independent process
- Add bin/backend_accounting.py for standalone LLM billing loop
- Rewrite start.sh with two-phase startup:
1. Independent backend programs (run once)
2. Sage Web workers (SO_REUSEPORT on same port)
- Rewrite stop.sh to handle both workers and backend processes
- Add .gitignore for build artifacts and runtime files
Architecture:
- CPU core detection for worker count
- All workers share port 9180 via SO_REUSEPORT
- Backend processes tracked in sage_backend.pid
- Workers tracked in sage.pid
- Refactor start.sh to launch multiple worker processes based on CPU core count
- Assign dynamic ports to each worker (base_port + offset)
- Update stop.sh to gracefully handle and kill multiple worker PIDs
- Implement PID file management for multi-process tracking