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>