Repository navigation
π fix: restore App reads for opt-in shared-UID agents - #14790
hivecommons-hive[bot] merged 2 commits into
Conversation
Mint and refresh read-only per-agent caches when github.shared_uid_read_token is enabled and App auth is configured. Keep shared-UID agents off direct MCP and mint credentials, and document the loss of cross-agent read isolation. Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com> Hive-Run: hivecommons#14778 Hive-Plan: shared-uid-read-token Hive-Spec: issue-14778#proposal Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
@thatguywob this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity. |
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether shared-UID read tokens are minted automatically whenever App auth is configured (as #14778 proposes) or only behind the new default-off github.shared_uid_read_token flag this PR adds.
Credential-path change; mechanics look sound, but it diverges from the issue on one point a maintainer has to settle.
What I verified at v5 @ 4fc7d11:
src/pkg/github/app.go:307-316adds ashared-uid-readtier whose installation permissions are read-only on metadata/contents/actions/checks/pull_requests/issues, andmanager_tokens.goagentTokenTierreturns that tier for everyUID == 0agent regardless of role β so a shared-UIDci-maintainercannot obtain a write token through this path. Mint-token issuance and theGITHUB_TOKENtmux injection are both additionally gated onUID > 0, so shared agents get no second credential.credentials.goWriteAgentTokennever chowns (the tree only logs the uid atcredentials.go:33-37), so passingagentUID == 0is safe; the addedf.Chmod(0600)defends against the entrypoint's pre-created0640group-readable cache from a prior layout. Good.agentTokenCacheEnabledrequiresm.appAuth != nil, soHIVE_AGENT_TOKEN_CACHEis not exported to a shared-UID agent on an App-less hive β the wrapper's existingtoken_cache_unavailablebehaviour is unchanged there.
The decision: #14778 (your proposal) says to mint when UID == 0 and github.app_id is configured β no new knob. This PR instead adds github.shared_uid_read_token (config.go:3175-3178, default false) and documents that the reporting OpenShift spoke stays broken until an operator sets it and restarts. The trade is explicit consent to cross-agent cache readability vs. the fleet-generic "just works" the issue asked for. Either is defensible; it is a credentials-posture choice, not a code defect, so I am not judging it. If the opt-in stays, hive.yaml.example:919-922 and troubleshooting.md:366-376 already describe it accurately.
Not a defect, one observation: settings_parity_allowlist.txt marks the key yaml-only; if the flag survives, the dashboard will not surface that a spoke is running with cross-agent read isolation off beyond the boot log line added in manager.go:863-865.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Needs a decision, not a merge:
Head: verdict requires_human @264ff9b, 55/55 checks green, DCO yes, soak 0s of 30m0s. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
/hive decision approve Approving head |
clubanderson
left a comment
There was a problem hiding this comment.
Owner approval for head 264ff9b β see /hive decision approve above. Default-off opt-in flag, read-only token tier, App-only.
|
LGTM label has been added. DetailsGit tree hash: db2f42c86b9d70f8af11b68c500e8bb26a4d0fe7 |
|
|
|
Merged by hive contributor-lane auto-merge: CI green for β₯30m, reviewer verdict not required, @thatguywob holds the trusted tier in this hive's contributor registry. |
Summary
Shared-UID Kubernetes agents currently have no scoped App cache, so
gh run list,gh api, andgh pr viewfail even when the hive has working App authentication.Add default-off
github.shared_uid_read_token. With App auth configured, shared-UID agents receive per-agent0600cache files andHIVE_AGENT_TOKEN_CACHEat launch, with periodic refresh and credential recovery. Their tokens grant only metadata, contents, actions, checks, pull requests, and issues read access, regardless of agent role. Writes continue through relays; shared agents receive no direct MCP or additional mint credential through this path.Wire the option into both runtime launch modes, report the posture beside the missing-UID-map boot message, and document setup and the loss of cross-agent read isolation. Existing dedicated-UID behavior stays intact.
Related issues
Fixes #14778
Testing
gofmt -lon all changed Go files: clean.git diff --check: clean.Contributor checklist
v5, uses the repository title convention, and includes DCO sign-off and issue-author credit.β hive: backend=codex
π Hive Agent:
contributor| SHA:1b47956ff