Repository navigation
feat(github): connect personal accounts alongside the system account - #133799
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
366a583 to
df330a8
Compare
df330a8 to
e4553e7
Compare
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.
481fc1a to
aaa44a7
Compare
aaa44a7 to
5f96495
Compare
|
@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. |
|
🦞🧹 I asked ClawSweeper to review this item again. 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.
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 acceptreclaimed. 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
8c577fe4c434keeps 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-artifactspassed, including all 147 public SDK exports and UI size gates (startup JS: 8 requests, 336.9 KiB gzip).Full configured
check:changedpassed on the integrated source in Testbox run 33486410624, frozen tree881f72041fab4fceb9a6b49924a7e10e92cc3f73. 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.readandoperator.writecan 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
34ca836f7198onto8c577fe4c434: 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 withcreateNoisyPngBuffer; integration adopts that repair. The failure is retained as failed evidence.Published mobile correction
95685a9624eaon top of34ca836f7198: the original Kotlin generated decoder rejectedneeds_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, canonicalpnpm 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
95685a9624eapassed the normal configured targeted changed check in Testbox run 33493771138, frozen treebe84884341fdadfcd8aad8ca2885eeed00dfe189: 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_changedcan 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 readingmodels. 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:
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.