intake: configurable chat-only opt-out prefixes (💬, chat:)
Posts starting with an opt-out prefix (PULSE_BRIDGE_INTAKE_OPTOUT, case-insensitive) are never turned into a ledger item or kanban task and get no bridge reply. Codex review: no findings. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YECpkAwQUwgu7NVy91R8fW
This commit is contained in:
co-authored by
Claude Fable 5
parent
aaedf758d9
commit
5896d6cab1
@@ -72,6 +72,11 @@ HERMES_HOME_DIR = cfg("PULSE_BRIDGE_HERMES_HOME", str(HOME / ".hermes"))
|
||||
INTAKE_IGNORE_USERS = {u.strip().lower() for u in
|
||||
cfg("PULSE_BRIDGE_INTAKE_IGNORE",
|
||||
f"{POSTER_NAME},Ellie,AROS").split(",") if u.strip()}
|
||||
# chat-only opt-out: posts starting with any of these prefixes (matched
|
||||
# case-insensitively) are just talk — no ledger item, no task, no comments
|
||||
INTAKE_OPTOUT_PREFIXES = tuple(
|
||||
p.strip().lower() for p in
|
||||
cfg("PULSE_BRIDGE_INTAKE_OPTOUT", "💬,chat:").split(",") if p.strip())
|
||||
|
||||
|
||||
def log(msg: str) -> None:
|
||||
@@ -402,8 +407,9 @@ def intake_ingest(state: dict) -> None:
|
||||
if (ts < cp or m.get("thread_id") or m["id"] in state["intake"]
|
||||
or (m.get("user_name") or "").lower() in INTAKE_IGNORE_USERS
|
||||
or (m.get("user_id") or "").startswith("agent:")
|
||||
or content.startswith("🤖") or "ledger:" in content):
|
||||
continue
|
||||
or content.startswith("🤖") or "ledger:" in content
|
||||
or content.lower().startswith(INTAKE_OPTOUT_PREFIXES)):
|
||||
continue # opt-out posts are chat-only: no item, no task, no reply
|
||||
candidates.append(m)
|
||||
for post in sorted(candidates, key=lambda m: int(m["created_at"])):
|
||||
ledger_id = ledger_add_for_post(post)
|
||||
|
||||
Reference in New Issue
Block a user