diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ce0b54..274d6a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ All notable changes to this project are documented here. The format follows never the value (#77). ### Fixed +- Managed settings deny `EnterPlanMode`. A seat that entered plan mode left it + through ExitPlanMode's approval dialog, which only a person at the pane can + answer and a cross-session message cannot, so a dispatched seat waited there + overnight (a314). The brief a seat is dispatched with is the approved plan. - `developer-skills-sync` no longer reports `state=current` when this pass's fetch failed. A checkout whose fetches always fail (a 401 from GitHub) kept comparing HEAD with a stale `origin/main` and read current with `fetched=0`. diff --git a/rootfs/etc/claude-code/managed-settings.d/40-developer-seat.json b/rootfs/etc/claude-code/managed-settings.d/40-developer-seat.json index bb22e41..835e56a 100644 --- a/rootfs/etc/claude-code/managed-settings.d/40-developer-seat.json +++ b/rootfs/etc/claude-code/managed-settings.d/40-developer-seat.json @@ -1,5 +1,10 @@ { "autoCompactWindow": 500000, + "permissions": { + "deny": [ + "EnterPlanMode" + ] + }, "hooks": { "UserPromptSubmit": [ { diff --git a/tests/test_managed_settings.py b/tests/test_managed_settings.py new file mode 100644 index 0000000..49f8304 --- /dev/null +++ b/tests/test_managed_settings.py @@ -0,0 +1,26 @@ +"""The managed settings keep a seat from parking where no one can answer.""" + +from __future__ import annotations + +import json +import unittest +from pathlib import Path + +MANAGED = ( + Path(__file__).resolve().parent.parent + / "rootfs/etc/claude-code/managed-settings.d/40-developer-seat.json" +) + + +class PlanModeTest(unittest.TestCase): + # A seat that enters plan mode leaves it through ExitPlanMode, whose + # approval dialog only a person at the pane can answer. A cross-session + # message cannot, so a dispatched seat sat there overnight (a314). The + # brief a seat is dispatched with is the approved plan. + def test_entering_plan_mode_is_denied(self) -> None: + settings = json.loads(MANAGED.read_text()) + self.assertIn("EnterPlanMode", settings["permissions"]["deny"]) + + +if __name__ == "__main__": + unittest.main()