fix(service,features,desktop): a pull request a coding agent opened as its developer still reads as from Luke's agents

Merged
DA
3d ago
+126-8

Summary

PR 2 of 3, stacked on #2952. Agreed with the automations owner (worker 288, #2780).

With #2952, a coding agent that writes as its developer opens its PR on their token. The pull_request delivery then names the developer as sender, and "From Luke's agents" would stop matching. GitHub's performed_via_github_app is not on pull_request payloads: GitHub's OpenAPI has it on issue but not on pull-request or pull-request-webhook. So the head branch tells it instead.

  • PullRequestSchema reads head.ref beside head.repo (the fork check).
  • pullRequestSender: a person who opens, reopens, or marks ready a PR from a luke/ branch of the repository's own (not a fork) reads as LUKE_AGENTS. Reopened is already the OPENED moment, so there is no new moment.
  • synchronize (a push) stays keyed on the push sender, which is luke[bot] for every push an agent makes. The loop guard LUKE_AGENTS && pushed is unchanged.
  • Known limits:
    • A person who opens or readies a PR from a luke/ branch by hand is counted as Luke's agents. That mislabels the event but grants nothing.
    • Issues don't follow: an issue an agent opens as its developer has no branch to tell it by, so it reads as people's.
  • The editor's "From Luke's agents" detail now reads "What Luke's coding agents open, as you or as the workspace's GitHub App."

Evidence

  • pnpm check:affected: exit 0.
  • pnpm exec vitest run packages/service/src/github/github-webhook-app.test.ts: 8 passed. The new test runs seven deliveries against a people-only and an agents-only trigger:
    • A person's opened, ready, and reopened on luke/ are agents'.
    • The bot's push fires nothing.
    • The person's push to luke/, a fork's luke/, and any other branch are people's.

Invariants

  • ./scripts/check.sh green. (CI)
  • JSON Schema goldens unchanged.
  • Every behavior change has, in this PR, the test that fails without it; no change-detector test added.
  • Gateway envelope goldens unchanged.
  • No new as type assertion outside the allowlisted files.
  • No Effect.runPromise/runSync/runFork outside the runtime edges.
  • No new raw async primitives.
  • No Effect, Stream, or Layer written as a statement and dropped.
  • Test count: +1.
  • Nothing hand-rolled replaced.
  • Every CLAUDE.md/AGENTS.md sentence naming a changed part is edited (none names it).
  • PRIVACY.md unchanged.
  • Package deps match.
  • Barrel/door rule.

Notes

  • A desktop copy change with no capture: the one detail string under the "From Luke's agents" switch.

šŸ¤– Generated with Claude Code


Open workspace in Conductor


Devin Review


Summary by cubic

Fixes pull_request sender attribution so a PR a coding agent opens as its developer reads as from Luke's agents instead of from a person.

  • Uses the head branch ref and the action (opened, reopened, ready_for_review) to mark a PR from a luke/ branch of the repository as agent-opened.
  • Pushes remain keyed on the push sender, so the loop guard is unchanged.
  • A person manually opening or readying a luke/ branch PR counts as an agent, a mislabel that grants nothing; issues opened as a developer have no branch and still read as people's.
  • Updates the editor's description text for the "From Luke's agents" sender.