Skip to content

Channel-delivered user input (Telegram plugin) is dropped as isMeta — memory never saves #128

Closed

Description

@ondomru

Channel-delivered user input (Telegram plugin) is dropped as isMeta — memory never saves

Summary

When Claude Code receives user input through a plugin channel (e.g. the official
telegram plugin), the message is recorded in the session JSONL as
type: "user" with isMeta: true. extract_messages() drops every isMeta
record before counting, so human_count is structurally always 0.

With the default thresholds.min_human_messages: 3, save-session.sh then skips
on every single run:

[extract] 11 exchanges (0 human)
[extract] 0 human msgs < 3, skip

For a setup where all interaction arrives over Telegram, no memory file is
ever written. now.md never appears. The plugin looks healthy — hooks fire,
directories are created, no errors are logged — but it silently does nothing.

Each skipped run still spawns the background save, so this fails quietly rather
than loudly.

Environment

  • claude-remember 0.8.3 (official marketplace, claude-plugins-official)
  • Claude Code with the telegram plugin 0.0.6
  • Linux, Python 3.12

Reproduce

  1. Install the telegram plugin and drive a session entirely via Telegram messages.
  2. Send 3+ messages, enough tool calls to cross delta_lines_trigger.
  3. cat .remember/logs/memory-*.log → every run reports (0 human) and skips.
  4. .remember/ contains only logs/ and tmp/ — no now.md, ever.

A minimal repro without the plugin — one JSONL line is enough:

{"type":"user","isMeta":true,"message":{"content":"<channel source=\"plugin:telegram:telegram\" chat_id=\"1\" message_id=\"2\" user=\"u\" ts=\"2026-07-15T13:52:33.000Z\">\nDoes the remember plugin work?\n</channel>"}}
extract_messages(path)  # => []  (expected: [("HUMAN", "Does the remember plugin work?")])

Cause

pipeline/extract.py:

msg_type = obj.get("type")
is_meta = obj.get("isMeta", False)
if msg_type not in ("user", "assistant") or is_meta:
    continue

The isMeta filter is correct for genuine meta records, but channel-delivered
input is real human input that merely carries the same flag.

Suggested fix

Treat a <channel …>…</channel> payload as human input and strip the wrapper so
the summarizer sees the message text rather than transport metadata. Ordinary
isMeta records stay filtered:

msg_type = obj.get("type")
if msg_type not in ("user", "assistant"):
    continue

content = obj.get("message", {}).get("content", "")
channel_text = _channel_text(content)
if obj.get("isMeta", False) and channel_text is None:
    continue

texts = _extract_texts(content if channel_text is None else channel_text)

with

_CHANNEL_RE = re.compile(r"^<channel\b[^>]*>(.*)</channel>$", re.DOTALL)


def _channel_text(content) -> str | None:
    """Inner text of a <channel> block, or None if content is not one."""
    if not isinstance(content, str):
        return None
    match = _CHANNEL_RE.match(content.strip())
    if not match:
        return None
    return match.group(1).strip()

Verified locally against 0.8.3: human_count goes from 0 to 3 on a real
Telegram-driven session, and the existing test_extract.py suite stays green.

Happy to open a PR with the two regression tests
(test_extract_messages_keeps_channel_delivered_user_input and
test_extract_messages_still_skips_non_channel_meta) if useful.

Activity

  1. added
    bug
    on Jul 15, 2026
  2. added a commit that references this issue on Jul 27, 2026
    a62fe2d
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions