Fix Bot Mention Trigger Silently Discarded by Queue Worker Due to Raw Event Name Mismatch
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 67/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- github, node.js, typescript
調査の方向性
Read packages/core/src/review/resolve-job.ts and trace how it loads webhook_deliveries; compare that path with normalization in packages/provider-github/src/webhook.ts and delivery creation in packages/api/src/routes/webhook.ts. Start with the tests around resolveQueuedJob and add coverage for an issue_comment delivery and a closed pull_request delivery. Done means mention reviews and PR-close label cleanup run, existing auto-triggered reviews still work, and the listed typecheck, test, and lint commands pass.
索引モデルが issue の本文から書いたものです。
説明
Summary
Mention-triggered reviews (e.g. @codra review posted as a PR comment) are silently dropped before they ever reach the review worker. The pipeline queues the message, but the worker discards it immediately because it checks for a normalized event name that was never stored.
Root Cause
The webhook handler in packages/api/src/routes/webhook.ts reads the raw GitHub header x-github-event (value: "issue_comment") and stores it in the webhook_deliveries table as-is.
When the queue worker calls resolveQueuedJob in packages/core/src/review/resolve-job.ts, it loads the delivery and checks:
if (eventName !== "change_request" && eventName !== "comment") {
logger.info(`Queue message ignored: unsupported webhook event ${eventName}`);
return null;
}
Since delivery.event_name is "issue_comment" (raw GitHub header), not "comment" (the normalized name), the check fails and the message is thrown away. Mention-triggered reviews never execute.
The same mismatch applies to pull_request to change_request for PR-close label cleanup. Any job that takes the fallback path through the delivery lookup (without an inline jobId or payload on the queue message) can be affected.
Affected Files
packages/api/src/routes/webhook.ts- stores raweventNamein delivery and passes it raw to the queue message (L274-278)packages/core/src/review/resolve-job.ts- checks normalized names against raw stored names (L42-50)packages/provider-github/src/webhook.ts-normalizeGitHubWebhookcorrectly maps"issue_comment"to"comment", but is never called on the worker path
Proposed Fix
In resolveQueuedJob, after loading the delivery record, normalize eventName before checking:
// After loading delivery:
const normalized = env.webhooks.normalizePayload(delivery.event_name, delivery.payload);
if (normalized) {
eventName = normalized.eventName; // "comment" or "change_request"
payload = normalized.payload;
} else {
eventName = delivery.event_name;
payload = delivery.payload as WebhookPayload;
}
Alternatively (and more robustly), store the normalized event name in webhook_deliveries at insertion time in the webhook route, so the queue always receives the canonical name regardless of which path it takes.
Done When
-
@codra reviewcomments on a PR trigger a review job correctly - PR-close label cleanup runs for
pull_requestclosed events - Existing auto-triggered PR reviews (
opened,synchronize, etc.) continue to work - Tests cover the mention trigger path end-to-end through
resolveQueuedJob - Any backend changes work in both Cloudflare Workers and Node/Docker
-
npm run typecheck,npm test, andnpm run lintall pass
Before Closing
-
npm run typecheck,npm test, andnpm run lintall pass - Any backend changes work in both Cloudflare Workers and Node/Docker
- Tests cover the changed behavior in each affected runtime
- 主要言語
- TypeScript
- スター
- 125
- フォーク
- 23
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
devarshishimpi/codra のほかの issue
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
devarshishimpi/codra#178 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
devarshishimpi/codra#176 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
devarshishimpi/codra#186 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
devarshishimpi/codra#185 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
devarshishimpi/codra#184 ·
メンテナーはふだん 1 日以内に返信
devarshishimpi/codra の issue をすべて見る
似ている issue
-
agent-ready area: ui-server priority: p3 type: test
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
schlessera/brain-kit#4249 ·
メンテナーはふだん 1 日以内に返信
-
documentation tool triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
can1357/oh-my-pi#19608 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
dependencies tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
bcgov/nr-waste-plus#1549 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
blixvip/solana-token-meta#17 ·
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
blixvip/solana-tx-parse#18 ·