Skip to content

feat(reflection): add memoryReflection.includeGroupChats toggle for group-chat reflection generation - #971

Draft
gorkem2020 wants to merge 1 commit into
CortexReach:masterfrom
gorkem2020:feat/group-chat-reflection-toggle
Draft

feat(reflection): add memoryReflection.includeGroupChats toggle for group-chat reflection generation#971
gorkem2020 wants to merge 1 commit into
CortexReach:masterfrom
gorkem2020:feat/group-chat-reflection-toggle

Conversation

@gorkem2020

Copy link
Copy Markdown
Contributor

What

New knob memoryReflection.includeGroupChats (boolean, default true, so existing configs are a no-op). When set to false, the command:new / command:reset reflection hook skips reflection GENERATION for group-chat sessions, meaning session keys carrying a :group: or :channel: segment, and logs an info line naming the skip. Direct/DM/main sessions are unaffected either way.

Why

The reflection distiller's transcript input renders every non-self participant as a plain user turn, so on multi-agent group channels the distilled lessons and rules misattribute peer agents' messages (and can ingest a parallel session's status lines that ride the shared channel window). Observed live on a multi-agent fleet: a group-channel reset distilled peer-agent coaching and cross-session chatter into the standing rule set.

A structural fix for the distiller input (speaker-tagged transcript, matching the extraction pipeline's format) is the durable direction, but until that lands operators running multi-agent group channels need a supported way to keep reflections scoped to direct sessions. This knob gives them that choice without losing reflections wholesale.

Implementation

  • Config surface: memoryReflection.includeGroupChats added to the config type, to BOTH arms of the parsePluginConfig memoryReflection rebuild (normalized to boolean, default true), and to the manifest schema (nested property plus the config-docs entry).
  • isGroupChatSessionKey(sessionKey): single bounded regex (/:(group|channel):/i), no unbounded quantifiers.
  • Gate sits in the shared command-hook body directly after the existing excludeAgents guard, before any session-file recovery work, and returns early with an info log:
    memory-reflection: command:<action> skipped (group-chat reflection disabled, sessionKey=...).

Tests

Four cells added to test/command-reflection-guard.test.mjs (the existing full-register harness):

  • skips reflection generation for a :group: session when disabled (red-proofed: fails without the gate)
  • skips reflection generation for a :channel: session when disabled (red-proofed)
  • still reflects non-group sessions when the toggle is disabled (pin)
  • keeps group-chat reflection enabled by default (pin)

Full suite green, typecheck clean, dist rebuilt and committed, CI test manifest untouched (no new test files).

…roup-chat reflection generation

The reflection distiller's transcript input renders every non-self participant as a plain user turn, so multi-agent group channels distill misattributed peer content into standing rules. Until the speaker-tagged distiller input lands, operators can now set includeGroupChats: false to skip reflection generation for session keys carrying a :group: or :channel: segment (default true, no behavior change for existing configs). The gate sits beside the existing excludeAgents guard and logs an info line when it fires.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant