Skip to content

Persist observed room events as bare transcript rows for durable ambient group awareness #99257

Description

@obviyus

Ambient group awareness is capped by the per-turn window: observed room events should persist as bare transcript rows

Current behavior

With ambient group mode (room_event turns), the agent evaluates every unmentioned group message but is required to forget it: src/auto-reply/reply/get-reply-run.ts sets suppressNextUserMessagePersistence and suppressTranscriptOnlyAssistantPersistence for every room event, so neither the observed message nor the silent decision ever reaches the session transcript.

The agent's group knowledge is therefore only the per-turn chat-window snapshot: bounded (historyLimit, default 50), rebuilt from the message cache on every turn, and carried in the uncached tail of each prompt. Consequences:

  • A message older than the window that never coincided with an addressed turn is permanently invisible to the agent.
  • Session compaction cannot preserve ambient chat knowledge, because that knowledge was never persisted — there is nothing to summarize.
  • Every turn re-pays the full window in fresh (uncached) tokens. Raising historyLimit to widen awareness multiplies per-turn cost linearly in active chats.

Expected behavior

In ambient mode the transcript should become the durable chat log: each observed room event appends one bare envelope row (#44791 bh.ai: ...-style, no metadata prefix, no window snapshot, no assistant row when the turn stays silent) to the session transcript.

  • Append-only rows mean each group message costs its tokens once and is prompt-cache-hit on every later turn — strictly cheaper than a wide window in active chats.
  • Compaction then degrades ambient knowledge gracefully into summaries, exactly like any long conversation, so the agent still "knows" the gist of messages hundreds back.
  • The chat-window snapshot shrinks to a dedupe-aware sliver: only messages that arrived since the last persisted row, instead of a 50-message re-broadcast every turn.

Prior art: hermes-agent persists observed group chatter as observed: true transcript rows reclassified at replay; this proposal is the OpenClaw-shaped equivalent (single canonical history surface, channel-agnostic seam).

Design constraints

  • Must not reintroduce double history across turns: persisted ambient rows and the per-turn chat window need one dedupe boundary (the window covers only what the transcript does not).
  • Ordering: ambient rows and addressed turns must interleave in true chronological order; consecutive user-role rows must be provider-safe (CLI and API backends both accept consecutive user messages, but replay/sanitizers need to preserve them).
  • Mention-only mode has no room-event turn to do the appending; either batch-append observed messages on the next addressed turn or leave mention-only behavior unchanged (product decision).
  • Resume/replay (resumableText) and strip-inbound-meta must treat bare ambient rows as plain conversation, not metadata to strip.
  • Storage stays in the session transcript (no new sidecar stores); message-cache remains the transport-side source of truth for the window sliver.

Impact

Ambient-mode deployments get durable full-chat awareness with better cache economics than today's window, and silent turns finally leave a decision trail (the agent can see it already chose not to reply to a thread).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.enhancementNew feature or requestimpact:data-lossCan lose, corrupt, or silently drop user/session/config data.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRmaturity:stableIssue affects a taxonomy feature currently scored M4/M5.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions