{"version":"2.1.267","anchor":"sessioncompact-implementation-gated-by-disable-compact","canonical_anchor":"sessioncompact-implementation-gated-by-disable-compact","heading":"session.compact implementation gated by DISABLE_COMPACT","tier":"use","area":"Compaction","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.267\/e\/sessioncompact-implementation-gated-by-disable-compact","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.267","markdown":"### session.compact implementation gated by DISABLE_COMPACT\n\nsession.compact now blocks itself while DISABLE_COMPACT is set or a turn is still running\n\n**What**\n\nThe underlying implementation behind `session.compact` (used by `\/compact` and by plugins) now explicitly refuses to run in two cases: when compaction has been switched off for the session via `DISABLE_COMPACT`, or when a turn is currently in progress, since compaction is only allowed to happen between turns.\n\n**Why**\n\nThis prevents `\/compact` and plugin-triggered compaction from running at an unsafe time or when it's been deliberately disabled, giving a clear error instead of unexpected behavior.\n\n- Area: Compaction\n- Names: `DISABLE_COMPACT`\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 2\/5"}