feat(reflection): add memoryReflection.includeGroupChats toggle for group-chat reflection generation - #971
Draft
gorkem2020 wants to merge 1 commit into
Draft
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
New knob
memoryReflection.includeGroupChats(boolean, defaulttrue, so existing configs are a no-op). When set tofalse, 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
memoryReflection.includeGroupChatsadded to the config type, to BOTH arms of theparsePluginConfigmemoryReflection rebuild (normalized to boolean, defaulttrue), and to the manifest schema (nested property plus the config-docs entry).isGroupChatSessionKey(sessionKey): single bounded regex (/:(group|channel):/i), no unbounded quantifiers.excludeAgentsguard, 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)::group:session when disabled (red-proofed: fails without the gate):channel:session when disabled (red-proofed)Full suite green, typecheck clean, dist rebuilt and committed, CI test manifest untouched (no new test files).