Skip to content

active-memory: allowedChatTypes silently strips "explicit" sessions #65775

Closed
BingqingLyu/openclaw
#2476

Description

@dclosefuturex

Version: 2026.4.10

Problem

In extensions/active-memory/index.js, the normalizePluginConfig function whitelist-filters allowedChatTypes to only "direct" | "group" | "channel":

raw.allowedChatTypes.filter((value) =>
  value === "direct" || value === "group" || value === "channel"
)

The "explicit" session type (used for portal/webchat and named session bindings) is silently dropped. Users who add "explicit" to allowedChatTypes in their config see no error, but active memory never runs in those sessions.

Expected

Either:

  1. "explicit" is a supported value for allowedChatTypes and active memory fires in explicit sessions, OR
  2. An error/warning is surfaced when an unrecognized chat type is configured

Suggestion

Extend the filter to include "explicit", or replace the whitelist with a more permissive validation that warns on unknown values rather than silently discarding them. Users with webchat/portal sessions need active memory too.

Activity

  1. dclosefuturex commented on Apr 13, 2026

    @dclosefuturex
    ContributorAuthor

    Additional note: the openclaw.plugin.json schema also enforces the same enum whitelist, so even after patching index.js the gateway throws a config validation error:

    ERROR active-memory: invalid config: allowedChatTypes.3: must be equal to one of the allowed values (allowed: "direct", "group", "channel")
    

    Both index.js (runtime filter) and openclaw.plugin.json (schema validation) need to be updated together.

  2. dclosefuturex commented on Apr 13, 2026

    @dclosefuturex
    ContributorAuthor

    Found another layer to this bug. resolveChatType() in index.js only pattern-matches known session key segments (:group:, :channel:, :direct:, :dm:) but has no case for :explicit:. Portal sessions (agent:main:explicit:portal-...) fall through and return undefined, so isAllowedChatType always returns false regardless of what's in allowedChatTypes.

    Three places need updating together:

    1. normalizePluginConfig filter — add "explicit" to allowed values
    2. openclaw.plugin.json schema enum — add "explicit"
    3. resolveChatType() — add if (sessionKey.includes(':explicit:')) return 'explicit'

    Without #3, #1 and #2 have no effect.

  3. clawsweeper commented on Apr 26, 2026

    @clawsweeper
    Contributor

    Closing this as duplicate or superseded after Codex automated review.

    #65775 is still reproducible in current main, but the remaining work is already tracked by the dedicated open PR #66285. Current active-memory code still excludes explicit from the config type/normalizer, manifest enum, and resolveChatType() classifier; PR #66285 directly targets those same three gaps and says it closes this issue with schema/runtime/test coverage.

    Best possible solution:

    Close #65775 as superseded by the dedicated fix PR #66285, and use that PR as the canonical place to review and land the active-memory explicit chat type support. The best product/code outcome is to merge a focused fix that updates the plugin TypeScript types, config normalizer, manifest schema enum, resolveChatType() handling, and regression tests together.

    What I checked:

    So I’m closing this here and keeping the remaining discussion on the canonical linked item.

    Codex Review notes: model gpt-5.5, reasoning high; reviewed against e23d17da79dc.

  4. locked as resolved and limited conversation to collaborators on Apr 29, 2026
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

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions