Move the 1-5s commit_session_memory() extraction off the POST /api/session/new request thread (was blocking + New Chat) into a fire-and-forget daemon thread, guarded by the existing per-session in-flight serialization. Data-loss prevention on managed stop: - server.py installs a SIGTERM handler that requests an orderly stop so serve_forever()'s finally block runs drain_all_on_shutdown() (the default SIGTERM disposition terminated without unwinding, losing in-flight commits). - session_lifecycle: bounded self-unregistering background-commit registry; a _draining flag so no NEW worker starts once the drain begins (the inline generation-drain commits any late arrival instead); a 30s overall drain deadline so a stuck worker cannot hang the stop path forever. Co-authored-by: luperrypf <luperrypf@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| agent_health.py | ||
| agent_sessions.py | ||
| auth.py | ||
| auth_oidc.py | ||
| background.py | ||
| background_process.py | ||
| clarify.py | ||
| commands.py | ||
| compression_anchor.py | ||
| config.py | ||
| crash_visibility.py | ||
| dashboard_probe.py | ||
| extensions.py | ||
| gateway_chat.py | ||
| gateway_restart.py | ||
| gateway_watcher.py | ||
| goals.py | ||
| helpers.py | ||
| kanban_bridge.py | ||
| metering.py | ||
| models.py | ||
| oauth.py | ||
| office_documents.py | ||
| onboarding.py | ||
| passkeys.py | ||
| paths.py | ||
| plugin_providers.py | ||
| plugins.py | ||
| profiles.py | ||
| providers.py | ||
| request_diagnostics.py | ||
| rollback.py | ||
| route_approvals.py | ||
| route_session_list_cache.py | ||
| routes.py | ||
| run_journal.py | ||
| runner_client.py | ||
| runtime_adapter.py | ||
| session_discoverability.py | ||
| session_events.py | ||
| session_export_html.py | ||
| session_lifecycle.py | ||
| session_ops.py | ||
| session_recovery.py | ||
| skill_usage.py | ||
| sse_chunked.py | ||
| startup.py | ||
| state_sync.py | ||
| streaming.py | ||
| system_health.py | ||
| terminal.py | ||
| todo_state.py | ||
| turn_journal.py | ||
| updates.py | ||
| upload.py | ||
| usage.py | ||
| webui_session_db.py | ||
| workspace.py | ||
| workspace_git.py | ||
| worktrees.py | ||