Drop the shared AGENT_TOKEN as the primary credential. Each agent now acts as its own Gitea user (TOKEN_PM for @pm, TOKEN_OPS for @ops, …) for API calls, delegation/autopilot trigger comments, and PR merges.
What changed
agent.yml — the Run-agent step injects SELF_TOKEN, a ternary selecting the running agent's own token by name, falling back to AGENT_TOKEN for repos not yet migrated (e.g. homelab). Only that one token enters the agent process, so no agent can act as another. Skill-setup steps no longer carry a token (they only write docs).
Trigger gate — now trusts the agent roster (pm/junior/senior/lead/qa/ops) as comment authors, so an agent's own delegation/autopilot trigger comment (posted with its PAT, no 🤖 prefix) fires the next run. @ops added to the mention set.
publish.sh — TOK = agent identity (comments/replies); new TTOK = trigger/merge token (agent PAT, else AGENT_TOKEN fallback) for delegation, autopilot @qa triggers, and merges that must fire downstream deploys.
Re-mint TOKEN_QA with write:repository so @qa autopilot can merge.
Add the agent bot users to the gitea org (write) + as homelab collaborators.
Keep AGENT_TOKEN as the fallback until homelab is migrated to per-agent tokens.
Drop the shared `AGENT_TOKEN` as the primary credential. Each agent now acts as **its own Gitea user** (`TOKEN_PM` for @pm, `TOKEN_OPS` for @ops, …) for API calls, delegation/autopilot trigger comments, and PR merges.
## What changed
- **agent.yml** — the Run-agent step injects `SELF_TOKEN`, a ternary selecting the running agent's own token by name, falling back to `AGENT_TOKEN` for repos not yet migrated (e.g. homelab). Only that one token enters the agent process, so **no agent can act as another**. Skill-setup steps no longer carry a token (they only write docs).
- **Trigger gate** — now trusts the agent roster (pm/junior/senior/lead/qa/ops) as comment authors, so an agent's own delegation/autopilot trigger comment (posted with its PAT, no 🤖 prefix) fires the next run. `@ops` added to the mention set.
- **publish.sh** — `TOK` = agent identity (comments/replies); new `TTOK` = trigger/merge token (agent PAT, else `AGENT_TOKEN` fallback) for delegation, autopilot `@qa` triggers, and merges that must fire downstream deploys.
- **skill-gitea-api.sh / skill-gitea-admin.sh / run-agent.sh** — token env → `SELF_TOKEN`.
## Follow-ups (runtime, not in this PR)
- Re-mint `TOKEN_QA` with `write:repository` so @qa autopilot can merge.
- Add the agent bot users to the `gitea` org (write) + as `homelab` collaborators.
- Keep `AGENT_TOKEN` as the fallback until homelab is migrated to per-agent tokens.
Drop the shared AGENT_TOKEN as the primary credential; every agent now acts
as its own Gitea user (TOKEN_PM for @pm, TOKEN_OPS for @ops, …) for API
calls, delegation/autopilot trigger comments, and PR merges.
- agent.yml: Run-agent step injects SELF_TOKEN — a ternary selecting the
running agent's own token by name, falling back to AGENT_TOKEN for repos
not yet migrated to per-agent tokens (e.g. homelab). Only that one token
enters the agent process, so no agent can act as another. The gitea-api /
gitea-admin skill-setup steps no longer carry a token (they only write docs).
- Gate: trust the agent roster (pm/junior/senior/lead/qa/ops) as comment
authors so an agent's own delegation/autopilot trigger comment (posted with
its PAT, no 🤖 prefix) fires the next run. @ops added to the mention set.
- publish.sh: TOK = agent identity (comments/replies); new TTOK = trigger/merge
token (agent PAT, else AGENT_TOKEN fallback) for delegation, autopilot @qa
triggers, and PR merges that must fire downstream workflows.
- skill-gitea-api.sh / skill-gitea-admin.sh / run-agent.sh: AGENT_TOKEN/
TOKEN_OPS → SELF_TOKEN in the emitted skill docs and env contract.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Drop the shared
AGENT_TOKENas the primary credential. Each agent now acts as its own Gitea user (TOKEN_PMfor @pm,TOKEN_OPSfor @ops, …) for API calls, delegation/autopilot trigger comments, and PR merges.What changed
SELF_TOKEN, a ternary selecting the running agent's own token by name, falling back toAGENT_TOKENfor repos not yet migrated (e.g. homelab). Only that one token enters the agent process, so no agent can act as another. Skill-setup steps no longer carry a token (they only write docs).@opsadded to the mention set.TOK= agent identity (comments/replies); newTTOK= trigger/merge token (agent PAT, elseAGENT_TOKENfallback) for delegation, autopilot@qatriggers, and merges that must fire downstream deploys.SELF_TOKEN.Follow-ups (runtime, not in this PR)
TOKEN_QAwithwrite:repositoryso @qa autopilot can merge.giteaorg (write) + ashomelabcollaborators.AGENT_TOKENas the fallback until homelab is migrated to per-agent tokens.