Skip to content

Merge dev → main: decisionReason work-item-id resolution (#1239)#1240

Merged
zbigniewsobiecki merged 1 commit intomainfrom
dev
Apr 29, 2026
Merged

Merge dev → main: decisionReason work-item-id resolution (#1239)#1240
zbigniewsobiecki merged 1 commit intomainfrom
dev

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Fixes the Job queued: ... agent for work item (unknown) diagnostic that surfaced for check_suite-triggered respond-to-ci dispatches. The agent itself ran fine; only the dashboard log was affected.

🤖 Generated with Claude Code

… in decisionReason (#1239)

Prod incident 2026-04-29: a `respond-to-ci` dispatch logged
`Job queued: respond-to-ci agent for work item (unknown)` even though the
agent ran on the right PR. Root cause: the GitHub adapter's `parseWebhook`
extracts `event.workItemId` from `payload.pull_request.number` only —
`check_suite` webhooks store the PR number under
`payload.check_suite.pull_requests[0].number` and the parser leaves the
field undefined. The `respond-to-ci` handler resolves the PR internally
and returns it as `result.prNumber` + `result.workItemId`, but the
decisionReason builder used the parse-time `event.workItemId`.

The agent itself fired correctly; only the dashboard webhook log was
affected. Fix: a `resolveWorkItemLabel(result, event)` helper picks the
most specific label —
`result.workItemId > 'PR #' + result.prNumber > event.workItemId > '(unknown)'`.
Both the `Coalesced dispatch scheduled` and `Job queued` build sites use it.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/router/webhook-processor.ts 85.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@zbigniewsobiecki zbigniewsobiecki merged commit 9cb7284 into main Apr 29, 2026
15 checks passed
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.

1 participant