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
@@ -66,7 +66,12 @@ launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.shre.pulse-bridge.pli
|
||||
|
||||
New top-level posts in the `activity` channel written by a human (not the
|
||||
bridge, not agent accounts, not `🤖`-prefixed, not mirror posts carrying a
|
||||
`ledger:` tag line) become executed, tracked background work:
|
||||
`ledger:` tag line) become executed, tracked background work.
|
||||
|
||||
**Prefix a post with 💬 (or `chat:`) to just talk** — chat-only posts are
|
||||
never turned into a ledger item or task and the bridge never replies to
|
||||
them. The prefix list is configurable via `PULSE_BRIDGE_INTAKE_OPTOUT`
|
||||
(comma-separated, case-insensitive).
|
||||
|
||||
1. **Ledger item** — `shre-items add --kind pipeline --stage queued
|
||||
--tag pulse-intake`, title = first 80 chars of the post, detail = full
|
||||
|
||||
@@ -20,3 +20,6 @@ PULSE_BRIDGE_HERMES_DIR=/Users/aibot/.hermes/hermes-agent
|
||||
PULSE_BRIDGE_HERMES_HOME=/Users/aibot/.hermes
|
||||
# comma-separated user_names never ingested (bridge + agent accounts)
|
||||
PULSE_BRIDGE_INTAKE_IGNORE=Ledger,Ellie,AROS
|
||||
# chat-only prefixes (case-insensitive): posts starting with one of these are
|
||||
# never turned into work and get no bridge reply
|
||||
PULSE_BRIDGE_INTAKE_OPTOUT=💬,chat:
|
||||
|
||||
@@ -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