Repository navigation
feat(agents): configure per-agent GitHub identities - #125199
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
4241708 to
720005a
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 6:27 PM ET / 22:27 UTC. ClawSweeper reviewWhat this changesAdds Gateway-managed system and per-agent GitHub CLI identities, Control UI configuration, one-use credential setup, and local tool/Codex environment projection while preserving native credentials by default. Merge readinessKeep open for maintainer review: the latest head addresses the prior ambient-authentication concern and no definite line-level defect was found, but this is a security-sensitive core identity foundation whose Codex app-server contract could not be directly inspected in this environment. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI configures an agent identity through Gateway methods, which create a protected local GitHub CLI profile and pass only the applicable environment to local agent tools. Remote execution receives credential scrubbing rather than the managed identity, while local Codex runs receive the host-selected identity settings. flowchart LR
A[Operator in Agents Tools] --> B[Gateway identity setup]
B --> C[One-use secret handoff]
C --> D[Managed GitHub CLI profile]
C --> E[Agent identity configuration]
E --> F[Local tool environment]
E --> G[Local Codex harness]
F --> H[GitHub CLI and Git author]
G --> H
Decision needed
Why: The change adds persistent core configuration, Gateway protocol methods, protected credential-profile lifecycle, and altered local execution semantics; this ownership boundary needs maintainer intent beyond a mechanical code review. Before merge
Agent review detailsSecurityNone. PR surfaceSource +1926, Tests +2169, Docs +43, Generated +6, Other +173. Total +4317 across 74 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: Keep native credentials as the default and land the isolated local-profile design only after maintainer sponsorship, direct Codex 0.147 contract inspection, and fresh-plus-upgrade behavior evidence; keep cloud publication in the linked follow-up. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this is a new feature PR; source and focused tests cover native and managed paths, but the read-only grafted checkout cannot establish an independently runnable current-main flow. Is this the best way to solve the issue? Unclear pending maintainer intent: separating managed identities from shared gh auth is the sounder design, but core ownership and the exact Codex runtime contract still need confirmation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against aebe360349ae. LabelsLabel justifications:
EvidenceWhat 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 (12 earlier review cycles; latest 8 shown)
|
|
Nudge: This PR has been awaiting review for over 3 hours. |
ee2097d to
08a66d9
Compare
9ac273a to
fe61c11
Compare
|
Land-ready at exact reviewed head 95be5176ef8774cfebd09bfae7faa7b91ee97950.
No known proof gap remains for the local managed/native identity contract. Cloud publication remains the separate phase tracked in #125157. |
|
Merged via squash.
|
…es (#125472) The panel from #125199 rendered raw wire enums in code tags, used form-grid/field markup whose styles the agents page never loads (bare unstyled inputs outside the card), referenced non-existent avatar classes, and put callouts inside the settings group. Rebuild it on the canonical settings primitives: status rows with dot status and friendly source/evidence labels, a System/This Agent segmented scope control, the settings secret input (gains a disabled prop), a danger status row for errors, and a quiet-inherit + primary-save action row. Retitle to "GitHub Identity" and move it below Tool Access and Available Right Now. Add a .settings-account primitive for the 20px round avatar. Live-tested on an isolated dev gateway: native-credential verify via the GitHub API, segmented scope switching, and the empty-token error row. Controller behavior unchanged.
* feat(agents): add managed GitHub identities * fix(agents): use opaque GitHub setup handles * style(codex): format managed shell environment call * refactor(agents): own managed GitHub process identity * chore(config): refresh baseline after rebase * fix(ci): satisfy managed GitHub identity gates * fix(ci): repair managed GitHub identity checks * test(agents): align GitHub identity CI coverage * fix(codex): scope login shell isolation * fix(agents): let managed gh profiles authenticate * fix(agents): harden GitHub identity setup * test(gateway): align method suffix counts * fix(ui): serialize GitHub identity mutations * fix(protocol): generate GitHub configure requests * test(ui): restore timers after identity tests * fix(ui): preserve GitHub identity mutation ownership * fix(agents): preserve native GitHub CLI auth
…es (openclaw#125472) The panel from openclaw#125199 rendered raw wire enums in code tags, used form-grid/field markup whose styles the agents page never loads (bare unstyled inputs outside the card), referenced non-existent avatar classes, and put callouts inside the settings group. Rebuild it on the canonical settings primitives: status rows with dot status and friendly source/evidence labels, a System/This Agent segmented scope control, the settings secret input (gains a disabled prop), a danger status row for errors, and a quiet-inherit + primary-save action row. Retitle to "GitHub Identity" and move it below Tool Access and Available Right Now. Add a .settings-account primitive for the 20px round avatar. Live-tested on an isolated dev gateway: native-credential verify via the GitHub API, segmented scope switching, and the empty-token error row. Controller behavior unchanged.
Related: #125157
What Problem This Solves
Local agents on a shared Gateway could not inspect or deliberately select their effective GitHub CLI account. Operators had to mutate shared
gh authstate or inject bearer environment variables, so repository actions could use the wrong account or fail with a scope-related 403 even when the intended account had repository access.Why This Change Was Made
This adds a GitHub identity card under Agents → Tools. With no configuration, it reports and preserves the Gateway runtime user's native
ghidentity, including normal environment-token precedence and Git author. Operators can configure a managed system identity or a complete per-agent override, verify the account, and return to inherited/native behavior.Managed profiles use one-use secret handoffs, immutable private profile generations, lifecycle-owned expiry and startup cleanup, serialized Control UI configuration mutation, and a host-selected environment projected consistently into local OpenClaw and Codex start/resume/warm/supervision paths. The Gateway preview credential added by #125158 remains a separate service owner; an explicit preview SecretRef is removed from agent execution by its exact name.
The boundary is intentionally narrow: this selects the local
ghCLI/API identity and optional Git author. It does not claim generic Git transport isolation, forward credentials to cloud workers, or publish reconciled cloud branches. Gateway-owned publication is the next change in #125157.User Impact
Operators can inspect the account an agent will actually use, set a shared default, and override individual agents without switching global
ghstate. Tokens are pasted once, never returned to the browser, expire autonomously if abandoned, and managed profile generations retire on Gateway restart.Unconfigured installations preserve existing native GitHub authentication. Managed identities fail closed when their private profile is unavailable instead of silently falling back to another account. Processes with unrestricted host execution under the same OS account are not adversarially isolated; deployments needing that separation should use sandboxing or dedicated hosts/users.
Evidence
Exact reviewed head:
95be5176ef8774cfebd09bfae7faa7b91ee97950ToolsGitHubConfigureParamssupports managed/inherit branches and round-trips all four system/agent combinations; Swift/Kotlin generation and native checks passed501/501; runtime import-cycle and database-first guards passed/userverified the selected account, status reportedsystem-configured/available, child preparation blanked ambient GitHub token precedence, profile andhosts.ymlmodes were0700/0600, and the temporary state was deletedThe pinned Codex
0.147.0contract was inspected directly atbe6e8eac029b183056b7e4402879f15d2c85f61b:allow_login_shellcontrols login-mode command execution: https://github.com/openai/codex/blob/be6e8eac029b183056b7e4402879f15d2c85f61b/codex-rs/core/src/tools/handlers/shell/shell_command.rs#L71-L105setoverrides are applied after inherited environment filtering: https://github.com/openai/codex/blob/be6e8eac029b183056b7e4402879f15d2c85f61b/codex-rs/protocol/src/shell_environment.rs#L46-L102experimental_use_profile: https://github.com/openai/codex/blob/be6e8eac029b183056b7e4402879f15d2c85f61b/codex-rs/config/src/shell_environment_policy.rs#L133-L167Judged change split: production +1,962/-45; tests/test support +2,234/-10; generated +136/-3; docs +46/-3. Production growth establishes the new credential owner, Gateway API/config boundary, local execution projection, cleanup lifecycle, and operator UI.
Visual proof
Before — Agents → Tools has no GitHub identity owner:
After — the effective native account is visible and operators can configure a managed system or per-agent identity:
AI-assisted implementation; the Codex environment contract was verified directly against the pinned sibling Codex source.