Skip to content

fix(ui): manage agent GitHub accounts in Profile - #196200

Merged
hannesrudolph merged 13 commits into
openclaw:mainfrom
daniel-lxs:control-ui-github-accounts-by-agent
Nov 13, 2026
Merged

hannesrudolph merged 13 commits into
openclaw:mainfrom
daniel-lxs:control-ui-github-accounts-by-agent

Conversation

@daniel-lxs

@daniel-lxs daniel-lxs commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Closes #196136

What Problem This Solves

In Settings → Profile → GitHub accounts it is hard to see which GitHub account each agent uses, what changing "System GitHub" affects, or how to give one agent its own account (for example a token limited to a fork): only the selected agent is shown, and its own account sits behind "Advanced: agent GitHub override" in Agents → Tools.

User Impact

Profile → GitHub accounts lists My GitHub, the shared agent account and every agent with the account it uses, and every account change happens there:

  • My GitHub keeps its own section and is used only when you publish a PR with it.
  • Shared agent account (replacing the "System GitHub" label) is used by every agent without its own account. Its button counts the agents a change affects, for example "Change for 2 agents" (agents without agents.entries.<id>.tools.github).
  • One row per agent shows the GitHub username it uses and either "Uses the shared agent account" or "Own account · Personal access token". An agent's account, own or shared, serves its commands, its dashboard GitHub data, and Publish PR unless you choose My GitHub.
  • Per-agent actions: an agent on the shared account has Give its own account; an agent with its own account has Change and Use shared account. Setup opens inline under that agent ("Own account for {agent}", "Save for {agent}"), with GitHub authorization or a fine-grained PAT whose hint explains choosing only selected repositories with Contents and Pull requests read and write.
  • Rows stay current without a reload. tools.github.configure replies once the Gateway runs on the saved account, so every agent that inherits a changed shared account shows the new account right away.
  • Agents → Tools shows the agent's account read-only with Manage accounts in Profile; the duplicate override setup is removed.
  • Reconnect hints (the screen action github_identity_settings, the github_identity_status hint, the publication-failure next step) open Settings → Profile → GitHub accounts. The Publish PR picker and the chat publication report line use the same names ("Shared agent account", "Own account").

Permissions and account behavior are unchanged: agent rows and their actions need operator.admin; saving uses the same tools.github.configure calls (scope: "agent", managed or inherit); the "Use the shared agent account for new replies?" confirmation stays, and changes apply to new replies.

Why This Change Was Made

The roster reuses the existing scoped identity owners (tools.github.status with selectedScope: "agent" per agent, tools.github.configure), so there is no new Gateway method, record or config shape. Profile becomes the one place to view and change every agent's GitHub account, and Agents → Tools only shows it. That product choice, which ClawSweeper's review of #196136 also raises, needs a maintainer's yes.

Clients re-read every inheriting agent as soon as the configure reply arrives, while the config hot reload applies the write a few hundred milliseconds later. tools.github.configure therefore attaches the existing config-write application receipt (the one agents.* methods already wait on) and replies after the Gateway runs on the written config. A saved identity that is not applied immediately still replies with its saved status and logs a warning.

The reconnect screen action loads its Profile destination on demand (ui/src/app/github-accounts.ts), so the boot bundle does not carry it. The unused startup strings "For me" and "For the system" are removed.

Relationship to #192350 (open; moves GitHub repository integration into the bundled github-repositories plugin): this PR changes presentation and where an agent's account is set, not owners, records, methods or config shape, so both can coexist, but they conflict mechanically (17 of these 37 files are also changed in #192350). If #192350 lands first, this rebases onto the plugin: the Profile component, strings and tests move to extensions/github-repositories/browser/, the agent count reads plugins.entries.github-repositories.config.agents.<id>, and the read-only Agents → Tools change goes into the plugin's Agent tools contribution. If this lands first, #192350 carries the presentation along and points the count at the plugin config path.

Evidence

Real Gateway with real GitHub accounts

Isolated Gateway started from this branch, built Control UI, three made-up agents, read-only fine-grained PATs for two GitHub accounts. Tokens never appear in screenshots or logs; Gateway profile IDs are shown as <profile-A/B/C>.

  1. The shared agent account is set up with a PAT for @lamp-connection-test. Only tools.github is written (<profile-A>); no agent entry changes. Main, PR Irrigator and Release Notes show @lamp-connection-test · "Uses the shared agent account", and the shared button reads "Change for 3 agents".

    Shared agent account set up

  2. Give its own account for PR Irrigator, saved with a PAT for @daniel-lxs. Only agents.entries.pr-irrigator.tools.github is written (<profile-B>); tools.github stays <profile-A> and the other agents have no entry. PR Irrigator shows @daniel-lxs · "Own account · Personal access token", Main and Release Notes keep @lamp-connection-test, and the shared button reads "Change for 2 agents".

    PR Irrigator with its own account

  3. The shared agent account is replaced with a new PAT. tools.github moves to a new profile (<profile-C>); agents.entries.pr-irrigator.tools.github is still <profile-B>. Main and Release Notes use the replaced shared account; PR Irrigator still shows @daniel-lxs · "Own account".

    Shared account replaced, own account kept

Saved config after each step:

1 shared setup:        tools.github=<profile-A>  pr-irrigator=—            main=—  release-notes=—
2 own-account setup:   tools.github=<profile-A>  pr-irrigator=<profile-B>  main=—  release-notes=—
3 shared replacement:  tools.github=<profile-C>  pr-irrigator=<profile-B>  main=—  release-notes=—

Inheriting rows update without a reload

Real Gateway with a stubbed shared profile (no credentials). Main and PR Irrigator start on the shared account ("Configured, but unavailable"). After Use GitHub CLI on the shared account, both rows read "No account" in the same page, with no reload. The Gateway log shows the reply after the reload is applied:

[reload] config change detected; evaluating reload (tools.github, meta)    .229
[reload] config hot reload applied (tools.github)                          .416
res ✓ tools.github.configure 417ms                                         .596

Inheriting agent rows updated after a shared change

src/gateway/server-methods/tools-github.test.ts "replies only after the Gateway applies the written identity" fails when the reply is sent before the write is applied and passes with this change.

Other real-Gateway checks (no credentials)

A PAT that GitHub rejects: the Gateway answers tools.github.configure with "GitHub identity setup failed", the row shows the error, and the saved config is unchanged for every agent and the shared account:

Rejected token changes nothing

Agents → Tools shows the agent's own account read-only and links to Profile:

Agents → Tools is read-only

Use shared account for an agent removes only that agent's agents.entries.<id>.tools.github, and the count goes up by one:

Agent back on the shared account

Control UI boot size

scripts/check-control-ui-performance-base.mts against origin/main a7eb4eb, with this branch merged into it: passes. JavaScript is smaller than main on every boot route:

main This PR
Chat boot JS gzip 1,301,541 B 1,301,536 B (−5 B)
New-session boot JS gzip 803,204 B 803,199 B (−5 B)
Startup JS gzip 91,858 B 91,822 B (−36 B)

Tests

  • New Control UI e2e ui/src/e2e/github-accounts-agents.e2e.test.ts (mock Gateway): gives PR Irrigator its own account (tools.github.configure only for pr-irrigator), returns it to the shared account (inherit), then changes the shared account; Main and PR Irrigator follow and Release Notes keeps its own. Passes.
  • ui/src/e2e/screen-requester-routing.e2e.test.ts: the github_identity_settings screen action opens /settings/profile on the requesting browser, at that agent's row, and nowhere else. Passes.
  • src/gateway/server-methods/tools-github.test.ts: 16/16, including the apply-before-reply regression above.
  • UI unit and browser tests for the changed files (github-connections, github-identity-view, panels-tools-skills, app-shell-gateway.ui-command, settings-targets) pass; the chat publication picker, publication transcript and github_identity_status tests assert the new names and Profile destination.
  • tsgo:core, tsgo:ui, ui:i18n:verify, formatting, the Control UI controller guard and the line-cap ratchet are clean.
  • Test-line growth (+237 net: the new e2e and the Gateway regression test; the retired Agents → Tools override tests are removed) has an allocation in config/test-lines-allocations/196200-github-accounts-by-agent.txt.
  • ui/src/e2e/session-sources.e2e.test.ts fails two cases on main itself since fix(ui): Appearance settings stay loading for guests #196516 (c5d53d0): it passes before that commit and fails at it, with and without this branch. This branch alone (before that commit) passes 6/6. The remaining checks-ui-e2e failures also fail on main's scheduled CI.
  • Not run: the full suite.

@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@daniel-lxs
daniel-lxs marked this pull request as ready for review November 9, 2026 18:43
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: XL triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Nov 9, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 9, 2026
@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: ready, awaiting a maintainer decision.

What this changes

This PR lists every agent’s GitHub account in Profile, adds inline account management, and waits for saved configuration to apply before replying.

Example: Give PR Irrigator @daniel-lxs while Main uses @lamp-connection-test.

  • Before: Profile shows only the selected agent and sends account changes to Agents → Tools.
  • After: Profile lists both agents and supports changing PR Irrigator’s account while Main retains the shared account.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong real-Gateway evidence and no actionable introduced defects; the unresolved presentation decision caps overall readiness. Existing config paths, credential records, and serialized shapes remain unchanged.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected isolated-Gateway screenshots, saved-config facts, and reload logs demonstrate shared and per-agent PAT setup, own-account preservation during shared replacement, and inherited-row refresh after configuration application.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Preference · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: Users cannot see every agent’s account and inheritance relationship together or change an agent’s account directly from Profile.
Reason: The proposal addresses a concrete usability gap while changing an intentionally established settings workflow.

Merge readiness

⏳ Ready, awaiting maintainer decision

Keep this PR open: it provides a demonstrated usability improvement absent from current main, with no actionable introduced defects found, but consolidating account management in Profile still needs an owner decision.

Priority: P2
Reviewed head: f397b7de5fa51e7634d4c6a79bac70d95740a2c4
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should Profile become the single place to manage shared and per-agent GitHub accounts?
  • Recommendation: Approve consolidated Profile management: Adopt the all-agent roster and inline setup, preserving the presentation if the plugin migration lands.
  • Why: This replaces the existing advanced Agents → Tools workflow, and neither this PR nor its paired issue records an area-owner decision.

Before merge

None.

Findings

None.

Agent review details

How this fits together

Control UI account views consume agent and configuration snapshots, invoke existing scoped GitHub RPCs, and display Gateway-owned credential status.

flowchart TD
  A[Profile account roster] --> B[Scoped identity owners]
  B --> C[GitHub account RPCs]
  C --> D[Managed credentials and config]
  D --> E[Runtime config application]
  E --> B
  B --> F[Agent account status]
Loading

Technical review

Best possible solution:

Use the existing credential owners to present inheritance and inline agent actions together in an owner-approved management surface.

Do we have a high-confidence way to reproduce the issue?

Current-main source confirms the selected-agent-only Profile view and separate advanced editor; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch coherently reuses scoped identity owners, removes duplicate editing, and fixes response ordering at the Gateway owner; management placement remains a product choice.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d24b84d43eaf.

Provenance checked

  • Account setup placement and actions changes intended behavior with a stated reason (feat(agents): configure per-agent GitHub identities #125199: Agent settings exposed effective GitHub identity and deliberate system or per-agent selection; improve(ui): give each GitHub connection one action and its own setup #191314 later placed focused setup beneath account rows.)
  • Scoped identity state and lifecycle keeps the original intent (1cb8065: Plain identity owners retain request admission, credential custody, cancellation, and exact-client checks while Solid presents their state.)
  • Configure response timing changes intended behavior with a stated reason (6e458d8: The original handler returned status from saved configuration without awaiting runtime application; this PR documents and demonstrates stale inheriting rows caused by that ordering.)
  • Reconnect destination keeps the original intent (e937051: Reconnect opens masked account setup in the requesting Control UI without exposing authorization data to the model.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +161, Tests +236, Docs +3, Other +6. Total +406 across 36 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 13 350 189 +161
Tests 15 390 154 +236
Docs 7 17 14 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 1 6 0 +6
Total 36 763 357 +406

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Account management remains available in-product, but the existing split view makes inheritance and the scope of changes harder to understand.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (4 earlier review cycles)
  • reviewed 2026-11-09T19:04:22.455Z sha ac66b88bcc08d3491222503b055eada2f4bf4ad7 :: needs real behavior proof before merge. :: [P2] Qualify publication defaults by the agent’s effective account | [P2] Update the requester-routing E2E for the Profile destination | [P2] Account for the net test growth in the test-line budget | [P3] Remove documentation instructions for the deleted controls
  • reviewed 2026-11-11T01:50:35.524Z sha c588292cdcdca62d97d4f67a46c66a37c475729a :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-11T05:33:31.630Z sha 9c8a874 :: ready, awaiting a maintainer decision. :: none
  • reviewed 2026-11-12T21:07:14.284Z sha 24e4226 :: ready, awaiting a maintainer decision. :: none

Reviewed November 12, 2026, 8:51 PM ET / November 13, 2026, 01:51 UTC (Revision 5).

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Nov 11, 2026
@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 11, 2026
@daniel-lxs
daniel-lxs force-pushed the control-ui-github-accounts-by-agent branch from c588292 to 8c0d2f1 Compare November 11, 2026 02:48
daniel-lxs and others added 7 commits November 10, 2026 22:35
…ofile

Settings → Profile → GitHub accounts separates My GitHub from the agents'
accounts, renames System GitHub to Shared agent account with a count of
agents a change affects, lists every agent with the account it uses and
whether it is shared or its own, and opens an agent's own-account setup
inline under its row. Agents → Tools shows the account read-only, and the
reconnect hints point to Profile.

Refs openclaw#196136
The chat Publish PR account picker labels the shared account
"Shared agent account", matching Settings → Profile → GitHub accounts.

Refs openclaw#196136
…ish PR

The Publish PR account picker and the publication report in chat name an
agent's own account "Own account" and the shared one "Shared agent
account", matching Settings → Profile → GitHub accounts.

Refs openclaw#196136
The shared agent account also serves authenticated dashboard data and
Publish PR unless My GitHub is chosen. Its row, the agents section, help
and setup hint, and the docs now say so.

Refs openclaw#196136
…pplied

Clients re-read every agent that inherits a changed GitHub identity as soon
as the configure reply arrives. The reply went out before the config hot
reload applied the write, so those reads answered from the previous
identity and Profile kept showing stale agent rows. Attach the existing
config-write application receipt to the identity write and reply once the
Gateway runs on the written config.
The reconnect screen action is rare, so its Profile destination now loads
on demand instead of shipping in the shared boot chunk. Drop the startup
"For me" and "For the system" strings: no view uses them since setup opens
under the account it changes. Chat and new-session boot JS end below main.
@daniel-lxs
daniel-lxs force-pushed the control-ui-github-accounts-by-agent branch from 8c0d2f1 to f51e204 Compare November 11, 2026 03:55
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 11, 2026
@roboclaw-bot roboclaw-bot added the clawtributors PR from a clawtributor label Nov 11, 2026
@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
The reconnect command loaded a one-line helper through a dynamic import, and
the import's preload wrapper cost more boot JS than the helper it deferred.
Navigate to Profile directly; Profile itself stays outside the boot graph.
@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 13, 2026
@hannesrudolph
hannesrudolph merged commit 922f6e9 into openclaw:main Nov 13, 2026
133 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
* improve(ui): show each agent's GitHub account and set it inline in Profile

Settings → Profile → GitHub accounts separates My GitHub from the agents'
accounts, renames System GitHub to Shared agent account with a count of
agents a change affects, lists every agent with the account it uses and
whether it is shared or its own, and opens an agent's own-account setup
inline under its row. Agents → Tools shows the account read-only, and the
reconnect hints point to Profile.

Refs openclaw#196136

* improve(ui): name the shared account the same in the Publish PR picker

The chat Publish PR account picker labels the shared account
"Shared agent account", matching Settings → Profile → GitHub accounts.

Refs openclaw#196136

* improve(ui): call an agent's own GitHub account "Own account" in Publish PR

The Publish PR account picker and the publication report in chat name an
agent's own account "Own account" and the shared one "Shared agent
account", matching Settings → Profile → GitHub accounts.

Refs openclaw#196136

* improve(ui): say what the shared agent account serves besides agents

The shared agent account also serves authenticated dashboard data and
Publish PR unless My GitHub is chosen. Its row, the agents section, help
and setup hint, and the docs now say so.

Refs openclaw#196136

* fix(ui): describe each agent's effective GitHub account and finish the Profile cutover

* fix(gateway): reply to tools.github.configure after the identity is applied

Clients re-read every agent that inherits a changed GitHub identity as soon
as the configure reply arrives. The reply went out before the config hot
reload applied the write, so those reads answered from the previous
identity and Profile kept showing stale agent rows. Attach the existing
config-write application receipt to the identity write and reply once the
Gateway runs on the written config.

* perf(ui): keep the GitHub accounts reconnect out of the boot bundle

The reconnect screen action is rare, so its Profile destination now loads
on demand instead of shipping in the shared boot chunk. Drop the startup
"For me" and "For the system" strings: no view uses them since setup opens
under the account it changes. Chat and new-session boot JS end below main.

* fix(ui): load the GitHub accounts destination with a plain utility import

* perf(ui): open GitHub accounts from the boot shell with plain navigation

The reconnect command loaded a one-line helper through a dynamic import, and
the import's preload wrapper cost more boot JS than the helper it deferred.
Navigate to Profile directly; Profile itself stays outside the boot graph.
RomneyDa added a commit that referenced this pull request Nov 17, 2026
Allow initial guest PR preparation from the recorded project's published
history while preserving unpublished work and original PR identity.

(cherry picked from commit 2757947)

Stable adaptation: preserve the existing linked-identity fixture; expand
its options type and allocate exactly 89 regression LF instead of 84.
Production and documentation patches are unchanged from the source.

Companions: #188785 is present-equivalent. Later #188784, #190223,
#190576, #190542, #195413, #197229, #197243, #199717, #195787,
#197510, #193664, #199851, #199864, #197656, #198851, #193873,
#197594, #189006, #188904, #194025, #196200, #192283, #189010,
#188816 and e0466ff are not prerequisites to this scoped repair;
retain their separate intake dispositions. No later PR-number mentions.

Proof: baseline 4 failed/20 passed through registered agent action;
fixed 41/41 across preparation, refresh and base-action suites.
Type-aware lint4, formatting5, docs MDX1419 and diff check pass.
No live GitHub or full release qualification claim.

Co-authored-by: RomneyDa <[email protected]>
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: web-ui App: web-ui clawtributors PR from a clawtributor docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Control UI: make personal, shared, and per-agent GitHub accounts clear in Settings

3 participants