目的
channel / mcp_hook delivery mode で、webhook の取り扱い指示が毎ターン面から落ちている経路を塞ぐ。イベント配送は届いているのに、届いたものをどうするかを述べる面が無い。
観測事実(本セッション、2026-08-24)
LI_PLUS_WEBHOOK_DELIVERY=mcp_hook。ターン 1 で 9 pending GitHub webhook events (pull_request_review:1, workflow_run:8) が context へ注入された。しかし inspect も mark_processed も走らなかった。実際に走ったのは、PR #1763 の due check がその手続きを名指しした時点であり、注入から約 15 tool call 後である。
これは PR #1763 の観測エントリが自ら名指していた失敗方向そのものである:
Both failure directions are real — main invoking the stub anyway is regression, and the intake silently not happening is the relocation losing the behavior.
もう一方の方向(stub を invoke してしまう)は起きていない。description の絞り込みは効いている。落ちたのは残り半分である。
前提(実測済み)
毎ターン hook の webhook ブロックは、分離可能な 2 つを運んでいる。
- ツールを呼べ —
Run mcp__github-webhook-mcp__get_pending_status silently.
- 結果をどう扱うか —
Report only foreground-relevant or notable items.
channel / mcp_hook が置き換えるのは (1) だけである。(2) を置き換えるものは無い。しかし条件式はブロック全体を落とすため、(2) も一緒に消える。3 port すべてで同形:
| port |
条件式 |
落ちる行 |
adapter/claude/hooks/on-user-prompt.sh |
:28 |
:30-33 |
adapter/codex/hooks/on-user-prompt.sh |
:39 |
:40-44 |
adapter/codex/hooks/on-user-prompt.ps1 |
:41 |
:42-46 |
正本は rules/operations/main-agent-procedures.md ## Foreground webhook notification intake にあり、always-on で載っている。しかしその発火時刻は :484 が述べるとおり each user turn start であり、always-on 常駐はロード保証であって発火保証ではない。ターン境界を発火できる面は hook だけである。
mark_processed については、poll ブランチも運んでいない。rules/operations/operations.md:91 は mark_processed is mandatory for every consumed webhook event. Omission causes backlog accumulation. と述べており、main-agent-procedures.md:493 は own-operation event の promptly な処理を要求する。3 モードのいずれの hook 面にもこの語は現れない。
先例
同一の推論が同一リポジトリに既にある。rules/model/trigger-check-gate.md ## Trigger firing:
Do not re-add a self-declaration trigger: a forgettable relief path is strictly dominated by the deterministic hook.
5-axis Gate は同じ理由で on-user-prompt.sh の決定論的 re-arm へ移されている。本件は同じファイルの別ブロックに同じ修理を当てる。rules/model/subtractive-structural-beauty.md Application notes の「実行保証の無い手続きは構造へ置き換える」も同じ側を指す。
制約
変更予定ファイル
adapter/claude/hooks/on-user-prompt.sh — 条件分岐を 2 分岐化(poll = 呼べ + 扱え / channel・mcp_hook = 扱え のみ)
adapter/codex/hooks/on-user-prompt.sh — 同上
adapter/codex/hooks/on-user-prompt.ps1 — 同上
adapter/claude/hooks-settings.md — mcp_hook 記述の追従
adapter/codex/hooks-config.md — 同上
docs/5.-Notifications.md / docs/6.-Adapter.md — 該当記述があれば追従
tests/ — 3 port が全 mode で取り扱い行を運ぶことの契約テスト
目的
channel/mcp_hookdelivery mode で、webhook の取り扱い指示が毎ターン面から落ちている経路を塞ぐ。イベント配送は届いているのに、届いたものをどうするかを述べる面が無い。観測事実(本セッション、2026-08-24)
LI_PLUS_WEBHOOK_DELIVERY=mcp_hook。ターン 1 で9 pending GitHub webhook events (pull_request_review:1, workflow_run:8)が context へ注入された。しかし inspect もmark_processedも走らなかった。実際に走ったのは、PR #1763 の due check がその手続きを名指しした時点であり、注入から約 15 tool call 後である。これは PR #1763 の観測エントリが自ら名指していた失敗方向そのものである:
もう一方の方向(stub を invoke してしまう)は起きていない。description の絞り込みは効いている。落ちたのは残り半分である。
前提(実測済み)
毎ターン hook の webhook ブロックは、分離可能な 2 つを運んでいる。
Run mcp__github-webhook-mcp__get_pending_status silently.Report only foreground-relevant or notable items.channel/mcp_hookが置き換えるのは (1) だけである。(2) を置き換えるものは無い。しかし条件式はブロック全体を落とすため、(2) も一緒に消える。3 port すべてで同形:adapter/claude/hooks/on-user-prompt.sh:28:30-33adapter/codex/hooks/on-user-prompt.sh:39:40-44adapter/codex/hooks/on-user-prompt.ps1:41:42-46正本は
rules/operations/main-agent-procedures.md## Foreground webhook notification intakeにあり、always-on で載っている。しかしその発火時刻は:484が述べるとおりeach user turn startであり、always-on 常駐はロード保証であって発火保証ではない。ターン境界を発火できる面は hook だけである。mark_processedについては、pollブランチも運んでいない。rules/operations/operations.md:91はmark_processed is mandatory for every consumed webhook event. Omission causes backlog accumulation.と述べており、main-agent-procedures.md:493は own-operation event の promptly な処理を要求する。3 モードのいずれの hook 面にもこの語は現れない。先例
同一の推論が同一リポジトリに既にある。
rules/model/trigger-check-gate.md## Trigger firing:5-axis Gate は同じ理由で
on-user-prompt.shの決定論的 re-arm へ移されている。本件は同じファイルの別ブロックに同じ修理を当てる。rules/model/subtractive-structural-beauty.mdApplication notes の「実行保証の無い手続きは構造へ置き換える」も同じ側を指す。制約
channel/mcp_hookへ戻さないこと。on-user-prompt.sh:22-24が述べる double delivery(reminder text と mcp_tool entry の二重発火)はmcp_hook設定が防いでいる当のものである。追加するのは取り扱い半分のみ。test_every_port_anchors_the_same_bytesと同じ理由)。Source of truth is this file; keep hooks-settings.md reference consistent.と述べているため、adapter/claude/hooks-settings.md/adapter/codex/hooks-config.mdの記述も追従させる。Axis detail: rules/model/trigger-check-gate.md (always-on).で正本を指しているのと同じ形にする。変更予定ファイル
adapter/claude/hooks/on-user-prompt.sh— 条件分岐を 2 分岐化(poll = 呼べ + 扱え / channel・mcp_hook = 扱え のみ)adapter/codex/hooks/on-user-prompt.sh— 同上adapter/codex/hooks/on-user-prompt.ps1— 同上adapter/claude/hooks-settings.md— mcp_hook 記述の追従adapter/codex/hooks-config.md— 同上docs/5.-Notifications.md/docs/6.-Adapter.md— 該当記述があれば追従tests/— 3 port が全 mode で取り扱い行を運ぶことの契約テスト