Skip to content

Use PAT_FOR_PR for dragon-ai execution workflow#3701

Merged
cmungall merged 2 commits into
masterfrom
worker-use-pat-for-dragon
Apr 28, 2026
Merged

Use PAT_FOR_PR for dragon-ai execution workflow#3701
cmungall merged 2 commits into
masterfrom
worker-use-pat-for-dragon

Conversation

@cmungall
Copy link
Copy Markdown
Member

Summary

Switch the AI Agent GitHub Mentions worker path back to PAT_FOR_PR.

Why

The current Uberon setup uses the ai4c-agent GitHub App token for both:

  • the execution workflow (ai-agent.yml)
  • the review workflow (claude-code-review.yml)

That makes work execution and review both appear under the same bot identity in GitHub UI. This is confusing when ai4c-agent is meant to be reserved for review and dragon-ai-agent is meant to be the worker.

dismech separates these roles by keeping the worker on PAT_FOR_PR and the reviewer on the GitHub App token. This PR brings Uberon back to that model.

Changes

  • remove create-github-app-token usage from .github/workflows/ai-agent.yml
  • use PAT_FOR_PR for checkout, github-script, gh, and claude-code-action
  • update the workflow header comments to document the correct required secrets
  • leave claude-code-review.yml unchanged so review continues to run as ai4c-agent

🤖 Generated by @dragon-ai-agent

  • Model: claude-opus-4-7
  • Agent harness: codex
  • Triggered by: @cmungall

cmungall and others added 2 commits April 24, 2026 22:17
The Claude Code review workflow currently rejects PRs opened by the ai4c GitHub App because the bot allowlist only includes claude and github-actions. Add ai4c-agent so app-authored PRs can still be reviewed.

@dragon-ai-agent
Keep the worker workflow on PAT_FOR_PR so execution remains attributable to dragon-ai-agent while ai4c-agent remains reserved for review.\n\nSigned-off-by: @dragon-ai-agent
@ai4c-agent
Copy link
Copy Markdown

ai4c-agent Bot commented Apr 28, 2026

Claude finished @cmungall's task in 1m 50s —— View job


PR Review Complete ✅

Review checklist:

  • Hierarchy and parents are consistent — N/A (no ontology changes)
  • Definitions and supporting references look adequate — N/A
  • Obsolete or replacement handling is safe — N/A
  • OBO and ODK conventions appear preserved — N/A
  • No obvious CI, auth, or workflow regression ✅

Summary

This is a clean, intentional role-separation change. The execution workflow (ai-agent.yml) was using the ai4c-agent GitHub App token — the same identity as the reviewer — conflating two distinct bot roles in the GitHub UI. Switching back to PAT_FOR_PR correctly restores the intended separation:

  • Worker (dragon-ai-agent) → PAT_FOR_PR
  • Reviewer (ai4c-agent) → GitHub App token (unchanged in claude-code-review.yml)

Changes reviewed

.github/workflows/ai-agent.yml — All five token references consistently replaced with PAT_FOR_PR:

  1. actions/checkout token: in check-mention job ✅
  2. actions/github-script github-token:
  3. actions/checkout token: in respond-to-mention job ✅
  4. GH_TOKEN env export ✅
  5. claude-code-action github_token:

The id-token: write permission is correctly dropped from respond-to-mention — it was only needed to generate the GitHub App token via OIDC, and is no longer required with a PAT.

The header comment now accurately documents PAT_FOR_PR instead of AI4C_AGENT_APP_ID/AI4C_AGENT_PRIVATE_KEY.

.github/workflows/claude-code-review.yml — Only change is adding ai4c-agent to allowed_bots. This is a correct side-fix: since execution previously opened PRs as ai4c-agent, the review gate would have blocked them. Now that execution uses PAT_FOR_PR, this entry is harmless forward-compatibility — no regression.

No concerns

  • No other workflow files were touched.
  • check-mention job retains contents: read — appropriate for a PAT checkout.
  • respond-to-mention job retains contents: write, issues: write, pull-requests: write — still required for the agent to push branches and open PRs.
  • allowed_bots: "claude,github-actions" in ai-agent.yml is unchanged and correct.

APPROVED — safe to merge.

Copy link
Copy Markdown

@ai4c-agent ai4c-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: Use PAT_FOR_PR for dragon-ai execution workflow

Review checklist:

  • Hierarchy and parents are consistent — N/A (no ontology changes)
  • Definitions and supporting references look adequate — N/A
  • Obsolete or replacement handling is safe — N/A
  • OBO and ODK conventions appear preserved — N/A
  • No obvious CI, auth, or workflow regression ✅

Summary

This is a clean, intentional role-separation change. The logic is sound: the execution workflow (ai-agent.yml) was using the ai4c-agent GitHub App token (same identity as the reviewer), which conflated two distinct bot roles in the GitHub UI. Switching back to PAT_FOR_PR correctly restores the intended separation:

  • Worker (dragon-ai-agent) → PAT_FOR_PR
  • Reviewer (ai4c-agent) → GitHub App token (unchanged in claude-code-review.yml)

Changes reviewed

.github/workflows/ai-agent.yml — All five token references consistently replaced with PAT_FOR_PR:

  1. actions/checkout token: in check-mention job ✅
  2. actions/github-script github-token:
  3. actions/checkout token: in respond-to-mention job ✅
  4. GH_TOKEN env export ✅
  5. claude-code-action github_token:

The id-token: write permission is correctly dropped from respond-to-mention — it was only needed to generate the GitHub App token via OIDC, and is no longer required with a PAT.

The header comment updated to document PAT_FOR_PR instead of AI4C_AGENT_APP_ID/AI4C_AGENT_PRIVATE_KEY is accurate and helpful.

.github/workflows/claude-code-review.yml — The only change is adding ai4c-agent to allowed_bots. This is a correct side-fix: since the execution workflow used to open PRs as ai4c-agent, the review gate would have blocked them. Now that execution uses PAT_FOR_PR (and commits as dragon-ai-agent), this entry is harmless forward-compatibility — no regression.

No concerns

  • No other workflow files were touched.
  • The check-mention job retains contents: read — appropriate for a PAT checkout.
  • The respond-to-mention job retains contents: write, issues: write, pull-requests: write — still required for the agent to push branches and open PRs.
  • allowed_bots: "claude,github-actions" in ai-agent.yml is unchanged and correct (the agent should not be self-triggering via the GitHub App identity).

Safe to merge.

Copy link
Copy Markdown

@ai4c-agent ai4c-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No ontology changes. Workflow auth changes look correct and safe — see full review in the PR comment.

@cmungall cmungall merged commit 0698576 into master Apr 28, 2026
3 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