fix(hermes): acknowledge Claude bypass mode

This commit is contained in:
jenkins 2026-08-10 02:24:32 -03:00
parent 091a73d268
commit 10092a1d12
2 changed files with 14 additions and 0 deletions

View File

@ -19,6 +19,7 @@ def configure_claude_state(path: Path) -> None:
loaded = {} loaded = {}
if isinstance(loaded, dict): if isinstance(loaded, dict):
value = loaded value = loaded
value["bypassPermissionsModeAccepted"] = True
value["resumeReturnDismissed"] = True value["resumeReturnDismissed"] = True
path.parent.mkdir(parents=True, exist_ok=True) path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(json.dumps(value, indent=2) + "\n", encoding="utf-8") path.write_text(json.dumps(value, indent=2) + "\n", encoding="utf-8")

View File

@ -176,10 +176,23 @@ def test_claude_resume_prompt_is_persistently_suppressed(tmp_path: Path):
value = yaml.safe_load(state.read_text(encoding="utf-8")) value = yaml.safe_load(state.read_text(encoding="utf-8"))
assert value["promptQueueUseCount"] == 4 assert value["promptQueueUseCount"] == 4
assert value["bypassPermissionsModeAccepted"] is True
assert value["resumeReturnDismissed"] is True assert value["resumeReturnDismissed"] is True
assert state.stat().st_mode & 0o777 == 0o600 assert state.stat().st_mode & 0o777 == 0o600
def test_claude_unattended_state_is_created_for_a_new_home(tmp_path: Path):
state = tmp_path / ".claude" / ".claude.json"
client_config.configure_claude_state(state)
value = yaml.safe_load(state.read_text(encoding="utf-8"))
assert value == {
"bypassPermissionsModeAccepted": True,
"resumeReturnDismissed": True,
}
def test_agent_config_uses_bounded_noninteractive_approvals(): def test_agent_config_uses_bounded_noninteractive_approvals():
configmap = yaml.safe_load((HERMES / "agent-configmap.yaml").read_text()) configmap = yaml.safe_load((HERMES / "agent-configmap.yaml").read_text())
config = yaml.safe_load(configmap["data"]["config.yaml"]) config = yaml.safe_load(configmap["data"]["config.yaml"])