Skip to content

Replace the dmKind authorship stamp on reaction receipts with a neutral triggerAuthor fieldΒ #1018

Description

@lilyshen0722

dmKind now carries authorship for events that are not DMs

#970 stamps payload.dmKind on reaction receipts so classifyTrigger can tell a human πŸ‘ from an agent πŸ‘ β€” a human reaction resets the cascade streak, an agent reaction counts toward the cap so reaction loops terminate.

That works, and it was the right call to ship: it needs no kernel type and no wrapper change, so it runs on the 0.1.11 fleet exactly as deployed. Ruled by @fable-lead, who also flagged the debt this issue records.

The debt: dmKind is DM-named, and it is documented to agents as DM semantics. agentProvisionerServiceK8s.ts:416 puts this in the moltbot system prompt:

"The platform tags every chat.mention event with a dmKind… dmKind: 'user-agent' β€” a human just sent you a message."

A reaction receipt is not a DM and is not a message someone sent you. An agent reading its own prompt can reasonably misread the field.

Blast radius, checked before shipping: routing is unaffected. The DM conversational frame is built in enqueueDmEvent (agentMentionService.ts:1581-1653), a path reaction receipts never enter. So the exposure is an agent misreading the field, not mis-delivery.

The fix

A neutral payload.triggerAuthor: 'human' | 'agent', taught to classifyTrigger alongside the existing dmKind branch (enforcement.js:48-49). Both can coexist during rollout; dmKind stays for actual DMs, where it is honest.

Why it is not done already

classifyTrigger lives in the CLI, so a new field means a version bump, an npm publish, and a fleet restart before any seat honours it. #970 was blocked on reactions working now, and that sequence is a release cycle. Shipping the honest field first would have held reactions behind it.

Why this is an issue and not a code comment

@fable-lead's ask, and the reasoning is the general one:

"recorded debt that lives nowhere queryable is how the resetMs [comment drifted]"

The precedent is real. The resetMs docstring described a decay while the code implemented a silence window; both were "documented", neither was tracked, and the mismatch survived until it cost a day of misdiagnosis. A comment is read by whoever is already in the file. An issue is read by whoever is deciding what to work on.

Done when

  • payload.triggerAuthor stamped by reactionController alongside (or instead of) dmKind
  • classifyTrigger reads it with priority over the messageId lookup, same as dmKind today
  • CLI released and the fleet restarted onto it
  • dmKind removed from the reaction path, leaving it to mean only what its name says
  • The moltbot prompt at agentProvisionerServiceK8s.ts:416 updated if it still describes the old shape

Related

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