Skip to content

feat(github): connect personal accounts alongside the system account - #133799

Merged
steipete merged 6 commits into
mainfrom
steipete/github-identity-authorization-d3a301
Sep 1, 2026
Merged

steipete merged 6 commits into
mainfrom
steipete/github-identity-authorization-d3a301

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds My GitHub beside System GitHub in Settings → Profile. Identified operators can connect their own GitHub account without changing shared execution credentials, verified sign-in identity, or OpenClaw permissions. Publish PR shows the selected account and supports personal publication from an idle, reconciled local worktree. Implements #133590.

The authenticated durable profile owns its connection. The Gateway broker binds publication to that profile, connection generation, session authorization, and accepted worktree snapshot, then pins the selected credential for each child operation. Disconnect, reconnect, ownership changes, or workspace changes invalidate the original authority. Recovery after a Gateway restart requires the same owner to confirm the original request; recorded commit, push, and pull-request facts support recovery from uncertain external effects.

Personal and shared connections reuse the device-flow transport, credential verifier, private profile writer, and publication executor. The existing secret store owns OAuth credentials; a lazy additive companion table owns personal publication receipts without a schema-version bump. Ordinary agent shells and cloud workers retain their existing shared identity behavior. See GitHub connections.

Review improvements

The chat composer previously required placement state local, although the workspace owner and header also accept reclaimed. Reuse the shared cloud-placement predicate so an idle reclaimed workspace can publish; active remote work, running turns, and workspace conflicts remain blocked. Parameterized browser coverage also verifies confirmation recovery after reload for both local and reclaimed workspaces. Proof captures now use the existing per-test artifact allocator.

The latest review also found an incomplete mobile publication union. Kotlin generation omitted needs_confirmation, so a valid response failed decoding; the Swift generated model already supported it, but its exhaustive regression test did not compile. Kotlin generation now selects the missing variant and rejects any selected discriminated union with a missing concrete model before writing output. Android and Swift tests round-trip all five publication outcomes, including confirmation recovery.

The feature also consolidates personal/shared connection UI and publication ownership, verifies supplied credentials directly against GitHub's fixed account endpoint, and loads the login renderer through the existing lazy-element owner with visible retry behavior.

Validation

  • Reclaimed regression: the real rendered Publish PR button was disabled on the original PR head; the new regression failed before the fix. After the shared-predicate repair, all 13 browser cases across personal publication and workspace conflicts passed. These use a mocked Gateway and do not prove real GitHub OAuth or publication.

  • Original head aaa44a7c5c5a: 48 ordered publication cases passed on Linux Testbox run 33475373264. Existing UI evidence covered 153 unit cases and 48 browser cases.

  • Persistence proof run 33474143650: source-frozen base 621fdad778f5 → candidate, 15 phases and 367 assertions, shared schema 15 / agent schema 19. This is source compatibility proof, not an older packaged-binary downgrade claim.

  • The two-file reclaimed fix passed managed Codex autoreview at P0. Full-feature review of the complete frozen source passed in two chunks with no P0 findings. Both rebase range-diffs preserve every functional patch; only the generated boot manifest changes. The final refresh onto 8c577fe4c434 keeps all 40 changed GitHub implementation files byte-identical and preserves the startup patch ID when the generated manifest is excluded. The final manifest was regenerated again with the frozen install and stayed byte-identical.

  • Integrated head 5f96495de265: 130 publication/recovery cases across six files passed in the original serial file order; 74 browser cases across nine files passed, including personal/shared connection controls, reclaimed publication, login recovery, and startup/lazy loading. pnpm build:ci-artifacts passed, including all 147 public SDK exports and UI size gates (startup JS: 8 requests, 336.9 KiB gzip).

  • Full configured check:changed passed on the integrated source in Testbox run 33486410624, frozen tree 881f72041fab4fceb9a6b49924a7e10e92cc3f73. Command completed successfully in 30m6s; the one-shot instance and temporary sync checkout were cleaned up. This includes production/test/UI type checks, lint, format, dependency/export checks, selected tooling tests, and structural guards.

  • Rebuilt isolated Gateway: a real browser connected with operator.read and operator.write can open personal GitHub setup; System GitHub reports no credentials and is admin-managed with no mutation controls. This verifies the real UI/API permission boundary, not the pending OAuth exchange.

  • Final refresh 34ca836f7198 onto 8c577fe4c434: the sole conflict was the generated UI boot manifest after main added Mermaid. Frozen installation and canonical regeneration passed; all 74 browser cases across nine files passed again against the combined source. The reviewed GitHub implementation is unchanged. The subsequent mobile correction is described below.

  • The later changed gate run 33482750132 failed because an inherited worker test imported removed sharp. Main's existing refactor(deps): remove Sharp dependency chains #134923 replaces that fixture with createNoisyPngBuffer; integration adopts that repair. The failure is retained as failed evidence.

  • Published mobile correction 95685a9624ea on top of 34ca836f7198: the original Kotlin generated decoder rejected needs_confirmation; after regeneration the same compiled probe decoded it. The supported Android Gradle target passed 7 protocol tests with no failures or skips. Swift reproduced the missing exhaustive case before the fix, then passed 13 generated-model tests, including all five publication results. An omitted-variant generator control fails before output changes. House-format checks, canonical pnpm protocol:check, and managed Codex autoreview at P0 passed. The full artifact build also passed on this frozen candidate: all 147 public SDK exports and UI budgets, including 337.0 KiB gzip startup JavaScript.

  • Published correction 95685a9624ea passed the normal configured targeted changed check in Testbox run 33493771138, frozen tree be84884341fdadfcd8aad8ca2885eeed00dfe189: script types/lint, Android lint, selected tooling tests, and native schema guard. Remote command completed in 6m53s; the one-shot runner stopped and its exact temporary checkout and registration were verified absent.

Maintainer landing decision: After the missing authenticated proof was reported, the maintainer explicitly directed landing. Interactive GitHub consent was unavailable in this run. Real device authorization, account verification, personal push/draft-PR creation, and disconnect/reassignment denial at real GitHub I/O remain unverified; no successful OAuth exchange or live token refresh is claimed. The landing decision uses the source-level authority audit, ordered denial/recovery regressions, real Gateway UI checks, native mobile tests, and green exact-head CI run 33493627035. This is the explicit disposition of the remaining ClawSweeper proof requests; it is not a claim that mocked tests exercised GitHub.

Boundaries and follow-ups

Personal GitHub prevents cross-participant use through the personal API; it shares the existing trusted Gateway OS boundary. An administrator or unrestricted code running as that OS user is outside this isolation claim. Shared ordinary-shell profile-loss fencing remains tracked separately in #134323.

Source audit identified a recovery UX follow-up: an old unfinished receipt projected as identity_changed can be selected again after reconnect and a newer completed publication. Permanent acknowledgement/invalidation needs the persistence owner's design review. Selecting only the newest receipt would risk hiding an older unresolved external effect, so this PR does not make that shortcut.

One earlier artifact build failed its compiler topology snapshot while concurrent SwiftPM compilation populated native build caches; rerunning the frozen candidate after the native jobs ended passed. Native build-cache exclusion in that topology snapshot is a tooling follow-up, not an authorization or protocol change in this PR.

Two pre-existing follow-ups remain: missing trusted-proxy identity is correctly rejected with AUTH_IDENTITY_HEADER_REQUIRED, but its login hint reports a network failure; older passing chat metadata fixtures logged listener errors reading models. Neither is claimed fixed by this change.

LOC accounting against the integrated base: production +6842/−3012 (net +3830); tests/support +4898/−668 (net +4230). Generated bindings/manifests and docs are separate. The production growth implements profile-owned OAuth lifecycle, explicit account selection, and durable publication authority/recovery while removing duplicate shared implementations. The reclaimed fix itself is +2/−1, reusing the existing placement predicate. The mobile correction removes one net tooling line, adds 11 net regression-test lines, and regenerates 24 Kotlin model lines. No new configuration option is introduced.

UI evidence

Existing synthetic Profile comparison:

Before: Profile sign-in identity and credit only

After: personal and System connections remain separate

Rebuilt Gateway: read-only personal connection setup with System admin-managed

Reclaimed-workspace regression in the synthetic browser harness: the disabled Publish PR control and erroneous reclaim guidance before the fix; enabled publication and no reclaim-again message after it.

Before: reclaimed workspace incorrectly blocked

After: idle reclaimed workspace can publish

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: android App: android app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete force-pushed the steipete/github-identity-authorization-d3a301 branch from 366a583 to df330a8 Compare August 31, 2026 17:04
@steipete steipete self-assigned this Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 17:06
@steipete
steipete requested a review from a team as a code owner August 31, 2026 17:06
@steipete
steipete force-pushed the steipete/github-identity-authorization-d3a301 branch from df330a8 to e4553e7 Compare August 31, 2026 17:52
steipete added a commit that referenced this pull request Aug 31, 2026
Reuse only the startup-loading repair from e4553e7 (PR #133799), without its unrelated GitHub account feature. Preserve credential redaction, visible chunk recovery and exact request lifetime; regenerate the boot manifest from this tree.

The successful-connect regression fails before the change and passes afterward. All 31 browser scenarios and 45 UI unit tests pass; startup JavaScript measures 342865 bytes against the unchanged 347353-byte limit.
@steipete
steipete force-pushed the steipete/github-identity-authorization-d3a301 branch 2 times, most recently from 481fc1a to aaa44a7 Compare September 1, 2026 05:34
@steipete
steipete force-pushed the steipete/github-identity-authorization-d3a301 branch from aaa44a7 to 5f96495 Compare September 1, 2026 09:04
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Refreshed onto main and fixed personal publication from reclaimed workspaces by reusing the existing placement predicate. The regression failed before the fix; 130 publication/recovery cases, 74 browser cases, the full configured changed check, and the artifact build now pass. The body records proof and follow-ups. Real GitHub consent and Gateway-brokered personal publication remain pending and are still landing gates.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

Show My GitHub and System GitHub together in Profile, with self-owned OAuth management for identified readers and admin-only shared changes. Keep sign-in identity and co-author consent separate from tool credentials.

Broker explicitly selected personal PR publication against the current owner, role, connection, and local workspace. Retain original request and effect facts across interruption, require same-owner confirmation, and reuse existing publication recovery. Isolate managed credential setup from host-global GitHub authentication.

Refs #133590.
Reduce net production growth by 517 lines while preserving OAuth record contracts, personal authority, and publication recovery. Retain separate personal persistence and refresh lifecycles; expand boundary coverage.
@clawsweeper clawsweeper Bot added the P1 High-priority user-facing bug, regression, or broken workflow. label Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: android App: android app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant