fix(server): don't silently assign new Dependabot alert issues to an uninvokable agent - #1344
Conversation
1 similar comment
|
Hey @allyblockcast[bot]! Before this PR can be reviewed, a few things need attention: Missing or incomplete:
Once updated, push a new commit and these checks will re-run automatically. — commitperclip |
…uninvokable agent PAPERCLIP_DEPENDABOT_AGENT_ID is the sole configured owner for the Dependabot alert path with no fallback. Issue creation there assigned that agent unconditionally -- if it's paused, terminated, or otherwise uninvokable, every new alert (plus diagnostic and terminal-receipt rows) silently queued on a dead run path with no signal. Verified live: 5/5 non-terminal dependabot-origin issues company-wide were on a paused agent, created entirely after the pause (BLO-26613). Add resolveDependabotIssueAssigneeId() in dependabot-alert-issues.ts: checks the configured agent's invokability (existing getAgentWorkEligibility/ evaluateAgentInvokabilityFromDb machinery -- "paused" is deliberately assignable-to-work but not invokable) and falls back to unassigned (so allow_company_agent picks it up) when it isn't, logging distinctly so this can back a fleet-level alert rule. Wired into every issue-creation call site in the Dependabot path: the main alert-issue create, the webhook-diagnostic create, and the terminal-receipt create. Deliberately scoped to this one path (BLO-26613's explicit ask), not the generic issueService.create()/assertAssignableAgent() check used by manual assignment everywhere else -- broadening "assignable" to require invokability company-wide would change intentional workflows (e.g. handing work to a colleague who is currently paused) with no time to audit the blast radius. Also out of scope here: the paperclip-plugin-alertmanager path (same class of gap per the BLO-26613 thread, different plugin code), the fleet-level "single-owner route points at an uninvokable agent" signal, and draining the 5 already-affected rows -- flagged as remaining work on BLO-26613. New regression test in github-webhook.test.ts confirmed red against unpatched HEAD (assigneeAgentId was the paused agent's id, not null) and green after this change. Full existing dependabot/webhook/issues-service suites (339 tests) still pass. https://paperclip.blockcast.net/BLO/issues/BLO-26613 Co-Authored-By: Paperclip <noreply@paperclip.ing>
80e2a26 to
306dd7e
Compare
|
Addressed the
All CI lanes are now green ( Ready for human review/merge. |
|
@ally please review at head 306dd7e — stop silently assigning new Dependabot alert issues to an uninvokable agent. Focus on the fallback when no invokable agent exists. Context: the original review request on this PR was lost during the codex provider outage (BLO-27123) — codex |
Thinking Path
Linked Issues or Issue Description
Fixes: BLO-26613 (https://paperclip.blockcast.net/BLO/issues/BLO-26613)
fix(recovery): accept non-executing attribution owners) and fix(liveness): require a configured review workflow before invalid_review_participant (BLO-20725) #961 (fix(liveness): require a configured review workflow before invalid_review_participant) — neither touches the Dependabot alert creation path.What Changed
resolveDependabotIssueAssigneeId()inserver/src/services/dependabot-alert-issues.ts: looks up the configured agent, runs it through the existingevaluateAgentInvokabilityFromDbinvokability check (deliberately distinct from "assignable" —pausedis assignable-to but not invokable), and returnsnullinstead of the configured agent id when it isn't invokable, logging a distinct warning for a future fleet-level alert rule.resolveDependabotAlertIssue), the webhook-diagnostic create (recordDependabotWebhookDiagnostic, which also covers the BLO-16446 stale-wake backfill path since heartbeat calls through it), and the terminal-receipt create (recordDependabotTerminalReceipt).server/src/__tests__/github-webhook.test.tsasserting a new Dependabot alert issue files unassigned (not onto the paused agent) when the configured agent is paused.Verification
github-webhook.test.ts→ "files a new dependabot alert issue unassigned when the configured agent is paused". Confirmed red against unpatchedmaster(assigneeAgentIdwas the paused agent's id, notnull) and green after this change.github-webhook.test.ts+heartbeat-dependabot-stale-wake-backfill.test.ts+issues-service.test.ts— 339 tests pass.tsc --noEmitclean.Risks
issueService.create()/assertAssignableAgent()check used everywhere else (broadening "assignable" to require invokability company-wide would change intentional workflows like handing work to a colleague who is currently paused to resume later — out of scope here, no time in this change to audit that blast radius).allow_company_agentrouting is expected to pick them up.paperclip-plugin-alertmanager's assignee resolution, which has the same class of gap per the BLO-26613 thread but lives in different plugin code (packages/plugins/paperclip-plugin-alertmanager/src/webhook-handler.ts) — flagged as follow-up on BLO-26613.Model Used
Claude Sonnet 5 (
claude-sonnet-5), 1M-context mode, via Claude Code (Paperclip agent adapter). Standard reasoning, tool use (file edit/read, test execution via Bash, GitHub CLI/API). No extended thinking mode used for this change.Checklist
Fixes: #/Closes #/Refs #OR (b) described the issue in-PR following the relevant issue template