Repository navigation
fix(#64): skip teammate relays in session preview firstUserMessage - #66
Merged
Merged
Conversation
Guard firstUserMessage with isParsedUserChunkMessage so relay XML, system output and interruptions never become the sidebar preview; a later real user message now wins. Command fallback untouched. Co-Authored-By: Claude Code <noreply@anthropic.com>
axisrow
commented
Oct 8, 2026
axisrow
left a comment
Owner
Author
There was a problem hiding this comment.
Ревью PR #66 — fix(#64): skip teammate relays in session preview firstUserMessage
Вердикт: одобряю (approved). Изменений не требуется.
Проверено
- Фикс — ровно то, что предписывает issue #64: guard
firstUserMessageдополнен каноническим предикатомisParsedUserChunkMessage(делегирует вisUserChunkLineиз turn-accounting core) — единый источник истины, без копий предиката. - Command-fallback не сломан:
<command-name>проходит предикат (scripts/turn-accounting.mjs:86-125, тесты turnBudgetHookScript.test.ts:117) →firstCommandMessageзаполняется как раньше. - Регрессий не найдено: все ветки внутри guard (stdout/stderr, interruptions, command-name, пустой sanitized-текст) ведут себя идентично или строже в сторону улучшения (массивный контент с
<system-reminder>раньше мог протечь в превью — теперь нет). - Тесты покрывают оба случая из issue: relay-only →
firstUserMessage: null; релей с последующим реальным сообщением → берётся реальное. Фикстуры и cleanup соответствуют стилю соседних тестов. - Смешанная строка «релей + пользовательский текст» исключается целиком — это каноническая семантика
isTeammateRelayLine(любой relay-блок делает строку релеем), согласована с подсчётом ходов и хуком. - Ветка mergается с main чисто (MERGEABLE/CLEAN); изменения #55/#58 в той же функции — непересекающийся ханк.
Замечания вне скоупа (не блокируют)
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.
Teammate relays leaked into
firstUserMessageinanalyzeSessionFileMetadata: a session whose JSONL opens with<teammate-message ...>put the raw XML into the sidebar preview, and the!firstUserMessageguard kept a later real user message from replacing it.Fix: require
isParsedUserChunkMessage(parsed)in the firstUserMessage guard — the canonical predicate already in use one branch above (turn counting) also filters relays, system output and interruptions. Command fallback (firstCommandMessage) is unaffected:<command-name>passes the predicate.Fixes #64