{"version":"2.1.235","anchor":"per-session-state-containers-replace-module-level-singletons","canonical_anchor":"per-session-state-containers-replace-module-level-singletons","heading":"Per-session state containers replace module-level singletons across many subsystems","tier":"internal","area":"Internals","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.235\/e\/per-session-state-containers-replace-module-level-singletons","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.235","markdown":"### Per-session state containers replace module-level singletons across many subsystems\n\nLarge refactor moves many module-level singletons into per-session state, scoping caches to a session instead of the whole process\n\nDesign-tool consent\/plan\/grant state now lives on `toolState.get(...)` and is threaded through `checkPermissions`, the grants fetch, the plan store, and the project-grant observer, which now takes the tool state as a second argument. The MCP OAuth callback submitter map, the artifact auto-react store, the timer registries, the remote-settings verdict cache, and the API-key cache all moved into lazily-constructed per-instance holders.\n\nBehaviorally this scopes state to a session instead of the process, which matters for multi-session and background runs.\n\n- Area: Internals\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 0\/5"}