Repository navigation
fix: keep channel-delivered user input instead of dropping it as isMeta (#128) - #149
Merged
Merged
Conversation
…128) Channel-delivered input (e.g. the Telegram plugin) arrives as a type:"user" record flagged isMeta:true, wrapping the real message in a <channel>…</channel> transport envelope. extract_messages dropped every isMeta record, so a session driven entirely over such a channel counted 0 human messages and never crossed min_human_messages — memory was never saved. Add _channel_text() to detect and unwrap a <channel> payload; treat it as human input while ordinary isMeta records stay filtered. Co-Authored-By: Max <noreply>
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.
Closes #128.
Input arriving through a channel integration (the Telegram plugin in the report) is wrapped by the transport and carries
isMeta— the same flag Claude Code sets on genuine meta records.extract_messages()filtered on that flag before counting, so every real human turn in such a session was discarded: human count 0, min-human gate never cleared, no memory ever written for that whole class of users.The wrapped text is now recovered and counted as the human turn it is.
Note this is not fixed by #148's
min_exchanges_without_humanfallback: the reporter's session was 11 exchanges, still under the default 30 — and even when a long channel session does clear that threshold, the extract contains zero human turns, so the summary would be written from agent output alone.Fix and tests were written 2026-07-15 and never pushed; rebased onto current main, 528 passed.