Conversation
Yatsuiii
requested review from
a team,
carloshvp,
qubeena07 and
zohebk8s
as code owners
September 18, 2026 12:38
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Closes #653. Credit to @saintmalik for the report - the root-cause tracing to both defects, including the exact
config.py/startup.pyline citations, is theirs; this PR is the fix.session_state_pathwas documented (docs/configuration.md) and its feature described as shipped (CHANGELOG, merged #629), but was non-functional in two independent ways:_KNOWN_TOP_KEYS(config.py) omitted the key, soload_configrejected any config that set it, before the existing parsing code (config.py:489-491,:561) ever ran.run_startupnever constructed aSqliteSessionStateStore- only an import and aRuntimeContextdataclass field existed.RuntimeContext.session_state_storestayedNoneregardless of configuration, so the shared, persistent session-sensitivity ratchet never activated: a restart still lost the accumulated value, and multiple instances serving one session still ratcheted independently.Confirmed both by direct inspection before writing anything:
SqliteSessionStateStore(had zero call sites insrc/outside its own class definition.What changed
config.py: addedsession_state_pathto_KNOWN_TOP_KEYS.startup.py: added_open_session_state_store(), called fromrun_startupas step 5f. Opens the store whensession_state_pathis configured and wires it intoRuntimeContext; leaves itNone, unchanged, when unconfigured. An unopenable path fails startup closed (SESSION_STATE_STORE_UNAVAILABLE), mirroring the existingaudit_storeopen-failure pattern exactly.run_startup's already-high pre-existing complexity (measured at 26 on cleanmainbefore this change; unchanged after, since the helper is a single call site).Scope
The store's own logic (locking, hydrate/reset semantics, cross-process behavior) is untouched -
tests/unit/test_session_state_store.py's existing suite already exercisesSessionState.hydrate()against a realSqliteSessionStateStore, including a realmultiprocessing-based cross-process lock test. This PR only closes the wiring gap between that already-tested mechanism andrun_startup.Testing
run_startuptests (unconfigured staysNone; configured opens a real store and the file exists on disk, closed infinally; a store-open failure aborts startup - forced via monkeypatch rather than an OS-level directory trick, since this repo's CI runs both Linux and Windows).pytest tests/unit -q-> 1838 passed, 6 skipped, one pre-existing unrelated failure (test_startup_fails_on_unknown_tee_provider_name, fails identically on cleanmain, a local TPM auto-detection quirk unrelated to this change).