You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
triggergate denies task_assigned triggers when the assigning actor is a service account #626
Assigning a ticket to an agent member via the API with a service-account API key moves the ticket to In Progress (assignment automation fires), but no task_assigned conversation is ever created. The API log shows:
notification consumer: TriggerTaskAssigned failed ... err="you don't have access to use this agent or its environment"
Assigning the same ticket from the UI as a human works, which makes this look like a permissions problem but it is a principal-mapping bug.
Root cause
services/api/internal/transport/triggergate/gate.goallow() builds the actor principal as:
For a service_account member, MemberType is neither handled nor is UserID populated (UserID is documented as "the account id for a human member, zero-value otherwise" — domain/project/member.go). The principal therefore becomes user/00000000-0000-0000-0000-000000000000, which matches no grant, so AllowedAll denies and every service-account-triggered assignment fails the gate.
The store side already supports this: repository/postgres/iam_store.goListGrants resolves role attachments by ra.account_id regardless of account kind, and the authorizer explicitly accepts PrincipalServiceAccount (platform/authz/iam/check.go, authorizer.go:19). Only the gate mapping is missing.
plus a ServiceAccount(id string) constructor next to User/Agent in platform/authz/iam/check.go.
Workaround (until fixed)
Assign from the UI as a human, or perform the assignment call with a human user's API key — the gate passes for human members. Chat sessions (POST chat-sessions) are unaffected; they gate on project-level conversations:write.
Activity
pullfrog commentedon Oct 23, 2026
pikann commentedon Oct 23, 2026
Thank you so much for pointing this out. I will fix it soon