fix(storage): fix deadlock in SessionStore::create_session - #170
Merged
Conversation
create_session() calls get_session() while holding mutex_, but get_session attempts to lock the same non-recursive std::mutex, causing a deadlock. The session row is inserted into PostgreSQL but the HTTP response is never sent, hanging the /v1/sessions endpoint. Change std::mutex to std::recursive_mutex to fix the re-entrant lock.
…N.md 4-layer plan: CSS variable rewrite (warm monochrome), DesktopShell glass/blur unification, hardcoded color audit, interaction flow & animation tokens.
When running from build/cli/, the fallback path ../config/pipelines resolves to build/config/pipelines which doesn't exist. Add a second fallback that goes up two levels to find config/pipelines at the project root, covering the dev/build-from-source layout.
… calls When thinking mode is enabled, DeepSeek requires assistant thinking blocks to be echoed back in subsequent requests. The provider only preserved content blocks (thinking/redacted_thinking) when the assistant message had tool_calls, dropping them for text-only responses. This caused HTTP 400 errors on any follow-up turn after a thinking-enabled response. Also add error_body to the 4xx error message for better diagnostics.
Covers: global CSS tokens, DesktopShell glass/blur unification, hardcoded color replacement, page/agent/tab transition animations.
Replace ~30 occurrences of rgba(224,223,220,0.92) and similar variants with var(--border-subtle) across 10 component CSS files.
- PipelineNavigator: error/complete banners, confirm dialog, condMet → CSS variables - ChapterEditor: --hover → rgba(23,23,23,0.055), --violet → --muted-strong - HelpDrawer, WorldOnboarding, EndSceneModal: --brand-wash → --surface-muted - WorldSelector: backdrop and danger button colors → CSS variables - Sidebar: sessionItemActive border-color → --border-strong
- InspectorPanel: tabFadeIn animation on content area (180ms) - MainPanel: agentFadeIn animation on ChatTimeline wrapper keyed by agentId - Reduced-motion overrides for both animations
Keep DESIGN.md warm grey palette, --border-subtle, animation tokens, and the body::before dot grid. Merge in input/a:focus-visible selectors from main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SessionStore::create_session()wherestd::mutexis locked recursively viaget_session(id), causing the/v1/sessionsendpoint to hang indefinitelystd::mutextostd::recursive_mutexto support the re-entrant lock patternRoot Cause
create_session()acquiresmutex_, then callsget_session(id)which also tries to lock the samestd::mutex. On Linux with pthreads, this is undefined behavior and results in a deadlock — the session row gets inserted into PostgreSQL but the HTTP handler thread blocks forever, never sending a response.Test plan
POST /v1/sessionsreturns201with session JSON (was hanging/timeout before)POST /api/worldbuilding/worldsreturns200with world JSON