fix(gateway): detect prior sessions from disk in has_any_sessions() - #352
fix(gateway): detect prior sessions from disk in has_any_sessions()#352Farukest wants to merge 1 commit into
Conversation
|
Thanks for the detailed issue report and this PR, @Farukest. We went with PR #370's approach (using the SQLite database's session count) since the DB is the authoritative source for session history and avoids adding a new flag. Your analysis of the bug was spot-on and helped us evaluate both solutions. Closing this one in favor of #370. |
…n in skills_guard Authored by Farukest. Fixes NousResearch#385. Replaces startswith() with Path.is_relative_to() in _check_structure() symlink escape check — same fix pattern as skill_view() (PR NousResearch#352). Prevents symlinks escaping to sibling directories with shared name prefixes.
✅ Dream-Cycle Memory Bridge Implemented (BG-3)As part of the OpenClaw workspace automation work, a 📋 Extracted Insights (Live Evidence from First Run)Scan Stats: 29 total dream entries, 21 within last 7 days, 10 insight lines extracted with keyword matches. Theme Frequency Analysis
Key Insights Extracted
🔧 Implementation
Safety DesignThe bridge outputs to |
…n in skills_guard Authored by Farukest. Fixes NousResearch#385. Replaces startswith() with Path.is_relative_to() in _check_structure() symlink escape check — same fix pattern as skill_view() (PR NousResearch#352). Prevents symlinks escaping to sibling directories with shared name prefixes.
|
Publication evidence for the reviewed #352 integration candidate:
The branch update was a normal fast-forward only. This evidence does not merge or close PR #9 or #352. |
NousResearch#401) Exact owned-fork merge authorized by umbrella-auth-1533030101162266695 after semantic, security and immutable PASS plus 49 authoritative CI checks (44 success, 5 policy skips), exact head/base and clean mergeability readback. No NousResearch upstream mutation.
has_any_sessions()returnedlen(self._entries) > 1, but_entriesis keyed bysession_keyand each platform+chat combination has exactly one key. When a session resets, the old entry is replaced under the same key, so the count never grows. Single-platform users always gotFalseafter a reset, triggering the "first message ever" onboarding on every new session.Added a
_loaded_from_diskflag that is set in_ensure_loaded()whensessions.jsoncontains at least one entry.has_any_sessions()now returnsTruewhen either the flag is set or there are multiple keys, correctly detecting returning users regardless of how many platforms they use.Tests
Added
TestHasAnySessionstotests/gateway/test_session.pywith 6 tests:FalseFalseTrueTrueregardless of disk state_loaded_from_diskflag set whensessions.jsonhas data_loaded_from_diskstaysFalsefor emptysessions.jsonCloses #351