Skip to content

fix(approval): permanent command allowlist not loaded on startup #4739

@catbusconductor

Description

@catbusconductor

Bug Description

load_permanent_allowlist() in tools/approval.py is defined (line 304) but never called anywhere in the codebase.

The save path works correctly — when a user approves a command with /approve always, save_permanent_allowlist() writes the pattern to config.yaml under command_allowlist. However, on process restart, these patterns are never loaded back into the in-memory _permanent_approved set because nothing calls load_permanent_allowlist().

This means all "permanent" approvals are silently lost after every gateway or CLI restart, and users are re-prompted for the same commands they already permanently approved.

Steps to Reproduce

  1. Run hermes with approvals.mode: manual
  2. Trigger a dangerous command (e.g., python3 -c "print('hello')")
  3. Approve with /approve always
  4. Verify command_allowlist in config.yaml now contains the pattern ✅
  5. Restart the gateway
  6. Trigger the same command again
  7. Expected: Command is auto-approved from the persisted allowlist
  8. Actual: User is prompted again — the allowlist was never loaded

Root Cause

save_permanent_allowlist() is called in three places (lines 581, 792, 838) but load_permanent_allowlist() is never called anywhere — not at module import, not at gateway startup, not at CLI init.

Suggested Fix

Add at the end of tools/approval.py:

# Load permanent allowlist from config on module import
load_permanent_allowlist()

This is a one-line fix. The function already exists and works correctly — it just needs to be called.

Environment

  • Hermes Agent v0.6.0 (commit 3659e1f)
  • Gateway mode (Discord platform)
  • Ubuntu 24.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions