Skip to content

fix(sidecar): stop prefixing the speaker into the channel content - #29

Merged
smileygames merged 1 commit into
mainfrom
issue-28-speaker-prefix
Aug 21, 2026
Merged

fix(sidecar): stop prefixing the speaker into the channel content#29
smileygames merged 1 commit into
mainfrom
issue-28-speaker-prefix

Conversation

@smileygames

Copy link
Copy Markdown
Member

Closes #28

観測(実機、2026-08-21)

liplus-chat-room · マスター: マスター: ハロ~

原因

pushToChannelparams.content${user}: ${content} として組み立てる一方、params.meta.user にも同じ名前を入れていた。ホストは channel source と meta.user を自分で描画するため、content へ混ぜた名前が二つ目として現れる。

発言者はメタデータで運ぶものであって本文へ混ぜるものではない。混ぜると本文が発言そのものでなくなり、エージェントが引用や解析をするときに名前が本文の一部として扱われる。

参照実装(github-webhook-mcp local-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 — 表示の誤りの修正。

セッション側に届いた行が「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 smileygames linked an issue Aug 21, 2026 that may be closed by this pull request

@smileygames smileygames left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.tscontentparts.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 へ進む。

@smileygames
smileygames merged commit f47683a into main Aug 21, 2026
2 checks passed
@smileygames
smileygames deleted the issue-28-speaker-prefix branch August 21, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(sidecar): stop prefixing the speaker into the channel content

1 participant