Skip to content

isConversationalInjection: exempt chat:edited / chat:deleted (and chat:reaction-remove) markers like chat:reaction #157

Description

@Tengro

Summary

isConversationalInjection (src/framework.ts, around line 170 on main 8b612f5) treats an injected message as real conversational input unless it is a system marker or carries chat:reaction:

if (m.system === true) return false;
if (Array.isArray(m.tags) && m.tags.includes('chat:reaction')) return false;
return true;

zulip_mcp PR antra-tess/zulip_mcp#23 (issue #22) starts delivering message edits, topic moves and deletions as synthetic incoming messages tagged chat:edited / chat:deleted (RFC-001 core tags, already in mcpl-core 0.3.0's CHAT_TAGS). Those are markers about a message the agent has seen, not something it is replying to — the same category as a reaction. As written they:

  • clear explicit-send suppression: an agent that just send_messaged and then sees [edited] … Ann: typo fix on the channel gets its same-round prose auto-routed again;
  • count as a "new conversational round" for anything else keyed on this predicate.

chat:reaction-remove has the same gap today (only chat:reaction is listed), so a reaction being removed already behaves differently from one being added.

Proposed fix

const NON_CONVERSATIONAL_TAGS = new Set(['chat:reaction', 'chat:reaction-remove', 'chat:edited', 'chat:deleted']);
…
if (Array.isArray(m.tags) && m.tags.some((t) => NON_CONVERSATIONAL_TAGS.has(t))) return false;

Routing is unaffected on the zulip_mcp side (change lines carry no threadId and are excluded from lastIncoming), so this is only the suppression / round-boundary half.

Raised from the review of antra-tess/zulip_mcp#23 so the rollout chain is visible: zulip_mcp can ship first (the markers are correct without this), but until this lands an edit marker arriving mid-turn can re-open auto-routing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions