{"version":"2.1.267","anchor":"sdkheadless-sessions-get-an-explicit-rejection-for-compact","canonical_anchor":"sdkheadless-sessions-get-an-explicit-rejection-for-compact","heading":"SDK\/headless sessions get an explicit rejection for compact()","tier":"soon","area":"SDK","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.267\/e\/sdkheadless-sessions-get-an-explicit-rejection-for-compact","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.267","markdown":"### SDK\/headless sessions get an explicit rejection for compact()\n\nCalling compact() in headless SDK sessions now returns a clear rejection instead of silently doing nothing\n\n**What**\n\nHeadless sessions, meaning ones run with `-p` or through the SDK without the interactive terminal interface, now expose a `compact()` method, but calling it currently always fails with an explanatory error. That's because compaction in headless mode currently only happens inside a turn, triggered by a `\/compact` prompt, not through a separate method call.\n\n**Why**\n\nThis gives headless and SDK users a clear, catchable error explaining that `compact()` isn't available yet in that mode, instead of it failing silently or behaving unpredictably, so they know to work around it for now.\n\n- Area: SDK\n- Tier: Nothing to try yet\n- Useful: 3\/5\n- Signal: 3\/5\n- Present in the build but not switched on"}