Files
orca/cloud/apps
Neil 730334b4f5 fix(cloud): GH-AS-MEMBER PRs, comments and pushes from a cloud workspace show as the member, not the bot
stablyai/orca#42960 (Neil, dev) was authored by orca-cloud-dev[bot]. Neil had connected GitHub; member
identities only reached git: gh ran on the workspace placeholder (the App's installation token), and
the Worker's member route on api.github.com allowed only REST under the repo while gh pr create is
GraphQL.

- VM: a gh wrapper runs gh with the attested sender's own placeholder (orcad attests, as for git);
  plain gh otherwise. Behind GH_AS_MEMBER=on (dev on).
- Worker, api.github.com with a member placeholder: the member's own token only for REST under the
  workspace repo and for allowlisted authorship mutations whose every target resolves to it
  (repositoryId equals its node id; other ids looked up with the installation token, cached per repo,
  failures not cached). graphql-js parse; variable defaults, owner-level projectIds, duplicate
  top-level keys and anything unexpected are not member requests. Everything else goes out on the
  installation token as before; an out-of-repo pinned mutation is refused with a GraphQL error.
- Shared workspaces never approve or merge as a member (GraphQL and REST): those go out on the
  installation token, so branch protection still applies.
- Identity rule: the only person who can use a workspace always acts; in a shared one the latest
  sender acts until another member sends, for at most MEMBER_GIT_SHARED_MAX_MINUTES (default 480).
- A GitHub connect or disconnect mid-session reaches the running VM's identities now.
- Tokens never enter the VM.
2026-11-15 21:18:00 -08:00
..