fix(sidecar): stop prefixing the speaker into the channel content - #29
Merged
Conversation
セッション側に届いた行が「liplus-chat-room · マスター: マスター: ハロ~」と
なり、発言者名が二重になっていた。
pushToChannel が params.content を `${user}: ${content}` として組み立てる一方、
params.meta.user にも同じ名前を入れていた。ホストは channel source と meta.user
を自分で描画するため、content へ混ぜた名前が二つ目として現れる。
content を本文のみにした。発言者は meta.user が運ぶ。
発言者はメタデータで運ぶものであって本文へ混ぜるものではない。混ぜると本文が
発言そのものでなくなり、エージェントが引用や解析をするときに名前が本文の一部と
して扱われる。
参照実装が content に要約文字列を組み立てているのは、あちらが webhook イベント
という発言者のいない通知を扱っているため。発言者のある会話でそのまま真似たのが
誤りだった。
テストは match から equal に変えた。部分一致では名前の混入を検出できない。
#28
smileygames
commented
Aug 21, 2026
smileygames
left a comment
Member
Author
There was a problem hiding this comment.
AI self-review (execution_mode = auto)
受け入れ条件の照合(issue #28 完了条件)
| 条件 | 結果 | 根拠 |
|---|---|---|
params.content が本文と一致する |
pass | content をそのまま渡す。テストが assert.equal(pushed.params.content, "聞こえる?") |
params.meta.user が発言者を運ぶ |
pass | 既存の assert を維持 |
| テストが本文への名前混入を検出する | pass | assert.match から assert.equal へ変更 |
このテストが混入を通していた理由
従来の assert は assert.match(pushed.params.content, /Master: 聞こえる?/) だった。名前が混ざった形をそのまま期待値として書いていたので、混入は仕様として固定されていた。テストが誤りを検出しなかったのではなく、誤りを正解として記録していた。
assert.equal へ変えたのは、部分一致では「本文に余計なものが付いていない」ことを言えないため。#22 の「テストが実装と別の経路を通っていた」とは別の形で、同じ根:テストが実物を見ていなかった。
出典検証
参照実装 local-mcp/src/index.ts が content に parts.join(" ") で要約を組み立てているのは、扱う対象が webhook イベントという発言者のいない通知だから。literal を確認した上で、会話に持ち込んだのが誤りだったと判断した。
検証
- CI 全ステップ pass
- ローカルで
npm run sidecar:check/npm run sidecar:test
scope deviation
なし。
次の期待
execution_mode = auto のため人間レビューゲートなし。CI green(CI pass / check pass 1m56s)。self-review pass により squash merge へ進む。
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 #28
観測(実機、2026-08-21)
原因
pushToChannelがparams.contentを${user}: ${content}として組み立てる一方、params.meta.userにも同じ名前を入れていた。ホストは channel source とmeta.userを自分で描画するため、contentへ混ぜた名前が二つ目として現れる。発言者はメタデータで運ぶものであって本文へ混ぜるものではない。混ぜると本文が発言そのものでなくなり、エージェントが引用や解析をするときに名前が本文の一部として扱われる。
参照実装(
github-webhook-mcplocal-mcp/src/index.ts)がcontentに要約文字列を組み立てているのは、あちらが webhook イベントという発言者のいない通知を扱っているため。発言者のある会話でそのまま真似たのが誤りだった。変更
contentを本文のみに。テストはassert.matchからassert.equalへ変えた。部分一致では名前の混入を検出できない——実際、従来のテストは混入したまま通っていた。検証
npm run sidecar:check/npm run sidecar:test(pass 1 / fail 0)release type
patch — 表示の誤りの修正。