Skip to content

Fresh jobs can be enqueued without trigger actor #37

@pilipilisbot

Description

@pilipilisbot

Recent jobs can be created with trigger_actor = NULL, so the dashboard shows unknown actor for fresh queue entries.

Observed on the live DB after jobs #378-#383 were enqueued on 2026-05-25:

  • #378 pilipilisbot/github-agent-bridge#35 sync_after_merge: trigger_actor = NULL
  • #379 pilipilisbot/github-agent-bridge#33 open_issue: trigger_actor = NULL
  • #380 pilipilisbot/github-agent-bridge#36 sync_after_merge: trigger_actor = NULL
  • #381 gisce/webclient#3524 reply_comment: trigger_actor = NULL
  • #382 pilipilisbot/github-agent-bridge#32 open_issue: trigger_actor = NULL
  • #383 pilipilisbot/github-agent-bridge#34 sync_after_merge: trigger_actor = NULL

Diagnosis:

  • The local service install is currently stale: the checkout is v0.18.1 / 23eb2b9, but the editable package reported by the service venv is still github-agent-bridge 0.17.0.
  • This is not only an install drift issue. Current main still computes the trigger actor during enqueue only via trigger_actor_details_from_notification(n), which depends on the GitHub notification From: display name.
  • GitHub event notifications can arrive as GitHub <notifications@github.com> with useful context only in the URL/body, especially #event-... issue/PR event notifications. In that case the enqueue path stores NULL instead of falling back to GitHub API context lookup.
  • Manual checks show github_actor_details_for_context(...) can resolve actors for the stored contexts, for example issue/comment contexts and some PR/issue contexts. The problem is that this resolution is only available via backfill, not during normal enqueue.

Expected behavior:

New jobs should store trigger_actor and trigger_actor_avatar_url at enqueue time whenever the actor can be resolved from either:

  1. the GitHub notification sender display name, or
  2. the parsed GitHub context via GitHub API fallback.

Suggested fix:

  • Add an enqueue-time fallback in JobQueue.enqueue: if trigger_actor_details_from_notification(n) returns None, try resolving actor details from the parsed GitHubContext.
  • Avoid making this fallback mandatory for shadow/dry-run or unauthenticated test paths; failures should leave actor null rather than blocking enqueue.
  • Add tests for notifications with from_addr="GitHub <notifications@github.com>" and a resolvable issue/comment URL.
  • Consider parsing/storing #event-... IDs separately if we need the event actor instead of issue/PR author for merge/assignment events.
  • Operationally, add a deployment/version check so the service venv cannot silently lag behind the checked-out release.

Acceptance criteria:

  • A new actionable notification whose From: is GitHub <notifications@github.com> gets a non-null actor when GitHub API context can resolve it.
  • Existing From: ecarreras <notifications@github.com> behavior stays unchanged.
  • backfill-trigger-actors remains useful for historical rows but is not required for fresh jobs.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions