Repository navigation
fix(gateway): separate GitHub preview credentials - #125158
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready proof for exact head
Known proof gap: the dedicated SecretRef setting was not deployed to the production Team Gateway in this PR. The live proof exercised the exact PR-head GitHub client and credential-selection path in an isolated tree; deployment verification belongs to the post-merge rollout. |
|
Codex review: found issues before merge. Reviewed August 17, 2026, 5:21 AM ET / 09:21 UTC. ClawSweeper reviewWhat this changesAdds an optional SecretRef-backed Gateway credential for Control UI GitHub previews, project search, and managed repository cloning, while retaining ambient-token fallback when omitted. Merge readinessKeep open: the prior cached-preview availability finding is fixed, but the new global credential selector also changes Control UI session pull-request chips, outside the documented preview/project scope. That security and ownership boundary needs an explicit maintainer decision before merge. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway supplies GitHub-backed previews, project discovery, cloning, and session pull-request chips to Control UI. A credential resolver chooses the token used by those GitHub requests and determines what happens when a configured SecretRef is unavailable. flowchart LR
A[Control UI operator] --> B[Gateway GitHub features]
B --> C[Credential selection]
C --> D[Preview and project operations]
C --> E[Session pull request chips]
C --> F[Unavailable credential state]
D --> G[Control UI results]
E --> G
F --> G
Decision needed
Why: Credential scope determines both which GitHub identity is used and which UI behavior fails closed, so source review cannot infer the intended operator-security boundary. Before merge
Findings
Agent review detailsSecurityNeeds attention: The shared credential selector expands the new SecretRef's effective scope to session pull-request chips without an explicit ownership decision. PR surfaceSource +95, Tests +228, Docs +2, Generated 0. Total +325 across 25 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Confine the new credential to previews, search, and cloning until broader Control UI GitHub ownership is explicitly approved; otherwise document and test session pull-request chips as a deliberate consumer. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: configure the new credential, then load session pull-request chips; their existing shared resolver selects it even though the documented scope omits that feature. Is this the best way to solve the issue? No: the cache repair is sound, but the global selector makes an unreviewed credential-scope decision for session pull-request chips; either narrow it or explicitly support that consumer. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7ce934a8b5d0. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Maintainer scope decision for the latest ClawSweeper review: That consumer is explicit in the final The late credential-scope finding and its two rank-up moves are therefore addressed at exact head |
|
Merged via squash.
|
* fix(gateway): isolate GitHub service credentials * fix(gateway): harden GitHub credential isolation * refactor(gateway): scope GitHub preview credentials * fix(ui): refresh GitHub credential copy baseline * fix(gateway): revalidate cached GitHub previews
Related: #125157
What Problem This Solves
Fixes an issue where operators configuring GitHub access for Control UI previews, project discovery, and managed project cloning had to rely on the Gateway process-wide
GH_TOKEN/GITHUB_TOKENenvironment. An explicit unavailable credential was also treated like a missing credential, causing anonymous fallback and misleading setup guidance.Why This Change Was Made
This adds a dedicated SecretRef-capable
gateway.controlUi.github.tokenservice credential. A configured-but-unavailable reference now fails closed at the shared GitHub service boundary, while omitting the field preserves the existing environment and anonymous fallbacks for compatibility. GitHub-specific errors and doctor guidance now identify the dedicated setting instead of conflating it with an agent identity.This is the first change in the GitHub identity series tracked by #125157. It intentionally does not add per-agent identities or cloud publication.
User Impact
Operators can keep Gateway-owned GitHub reads under an explicit secret owner and receive truthful degraded-state errors when that secret cannot resolve. Existing deployments using
GH_TOKENorGITHUB_TOKENcontinue to work unchanged while they migrate.Evidence
git diff --check/userplus publicopenclaw/openclawrepository requests both returned valid responsesVisual proof
Before — the project picker described only the ambient
GH_TOKENmechanism:After — the picker distinguishes the dedicated Control UI credential from the legacy shared environment fallback:
AI-assisted implementation; behavior and owner boundaries were independently reviewed against the current Gateway and SecretRef contracts.