Skip to content

The agent that grows with you

fix(gateway): /help and /commands catalog gating tolerates a runner without config

teknium12c286d9d1763
diff --git a/gateway/slash_commands.py b/gateway/slash_commands.py
index 4f4466ee28f..84e6b72e7b5 100644
--- a/gateway/slash_commands.py
+++ b/gateway/slash_commands.py
@@ -591,7 +591,9 @@ class GatewaySlashCommandsMixin(
never advertises commands ``_check_slash_access`` would refuse. Admins / ungated -> {}."""
from gateway.slash_access import policy_for_source
source = event.source
- policy = policy_for_source(self.config, source)
+ # ``getattr``: partially-constructed runners (``GatewayRunner.__new__`` in tests) have
+ # no ``config``; policy_for_source treats None as ungated.
+ policy = policy_for_source(getattr(self, "config", None), source)
if policy.enabled and not policy.is_admin(source.user_id if source else None):
return {"allowed_commands": {"help", "whoami", *policy.user_allowed_commands}}
return {}