Skip to content

fix: load GitHub connections without a default agent - #139222

Merged
steipete merged 1 commit into
mainfrom
codex/github-status-system-scope
Sep 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/github-status-system-scope

Conversation

@steipete

@steipete steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Settings → Profile → GitHub connections fails to load on a Gateway with multiple agents and no default agent. The personal status API takes no agent selection, yet tried to resolve one before reading either account.

Related: #138724. Found during live validation of #138900; this repair applies independently to current main and stable 2026.9.1.

Why This Change Was Made

System GitHub status now resolves the shared account directly and reads Git author facts from the Gateway state directory. The same system identity resolver serves existing agent-aware selection, so native/managed credential precedence remains canonical. Agent tools retain their selected/effective account distinction and workspace-specific author facts. Personal authentication, current-role checks, OAuth, persistence, and protocol shapes are unchanged.

User Impact

People can view and connect My GitHub without selecting an agent or changing the agent roster. Status no longer probes an unrelated agent override or requires its workspace.

Evidence

  • Before: a real authenticated two-profile Gateway returned the multiple-agents/no-explicit-owner error for users.github.status {} before any OAuth grant.
  • Regression: both native and managed system account cases failed before the patch; the other 46 personal RPC cases passed. After the patch, all 90 personal RPC, shared-tool, and identity tests passed. The new cases also reject probing an agent override or using its workspace.
  • Candidate live verification passed through a real source Gateway and WebSocket: two explicitly owned agents, no default, fresh state/home, persistent Control UI client, registered loopback Origin, normal token/device admission. users.github.status {} returned personal disconnected and native system unavailable in 287 ms. Gateway shutdown completed cleanly in 103 ms; no OAuth grant or agent workspace was needed.
  • Formatting and focused lint passed; independent Codex review found no actionable P0–P2 issues.
  • Local aggregate checks could not complete: the current-main pnpm 12.3.4 bootstrap hits its minimum-release-age gate, and declaration checking rejects the shared dependency bridge. These guards were preserved; current-head CI owns the remaining full checks.

Production change: +61/-56, net +5 lines. This adds an explicit system status owner while consolidating identity selection and parameter types. Tests add 43 lines; docs clarify that profile connections need no agent selection. No schema, configuration, or protocol changes.

@clawsweeper

clawsweeper Bot commented Sep 5, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Sep 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 1:04 PM ET / 17:04 UTC.

ClawSweeper review

What this changes

Loads personal and shared GitHub connection status without a default agent, consolidates identity selection, and adds regression coverage and profile documentation.

Merge readiness

✅ Ready for maintainer review

This repair remains necessary: current main and v2026.9.1 still contain the failing agent-selection dependency. No blocking introduced defect was found.

Priority: P2
Reviewed head: 758ac6402c8c1d8f126318be644b0c66e090a9fe

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused ownership repair with useful native/managed regressions, reported real Gateway verification, and no blocking findings.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The maintainer-authored repair is exempt from the external-contributor proof gate and introduces no material authority change. Its captured body nevertheless reports the changed status endpoint succeeding through a real authenticated Gateway/WebSocket with two agents and no default.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored repair is exempt from the external-contributor proof gate and introduces no material authority change. Its captured body nevertheless reports the changed status endpoint succeeding through a real authenticated Gateway/WebSocket with two agents and no default.
Evidence reviewed 10 items Current-main failure remains: The status handler still calls resolveDefaultAgentId before reading either account. src/agents/agent-scope-config.ts resolves an unmarked multi-agent roster through resolveSoleAgentId, which throws AgentSelectionRequiredError.
Latest release remains affected: The supplied latest release, v2026.9.1, contains the same default-agent call; its agent-scope implementation also rejects multiple agents without a selected owner.
Repair belongs at the status owner: The new system-status entry point reuses system credential selection and probes author facts in the Gateway state directory. Agent-aware status retains workspace probing and separate selected/effective identities. This path uses OpenClaw's GitHub and process helpers; it does not invoke a Codex runtime or protocol.
Findings None None.
Security None None.

How this fits together

The Profile page asks the Gateway for the signed-in person's GitHub connection and the shared system account. The Gateway validates the current profile and returns account metadata for display.

flowchart TD
  A[Profile settings] --> B[Authenticated status request]
  B --> C[Current profile check]
  C --> D[Personal connection status]
  C --> E[Shared GitHub identity]
  E --> F[Credential and author metadata]
  D --> G[Connection display]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +5, Tests +43, Docs 0. Total +48 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 61 56 +5
Tests 1 43 0 +43
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 105 57 +48

Review metrics

Metric Value Why it matters
Production versus test LOC Production +61/-56 (net +5); tests +43/-0 The small production increase creates an agent-independent status boundary while consolidating selection logic; regression coverage adds no test-only production seam.

Technical review

Best possible solution:

Keep profile-level status independent of agent ownership while sharing credential resolution with the existing agent-aware tools.

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

Yes, from source: an authenticated status request with multiple agents and no default throws during agent selection before either account is read. The supplied before/after Gateway run corroborates this; tests were not rerun during review.

Is this the best way to solve the issue?

Yes. Reusing the shared identity owner removes the incorrect dependency without inventing an agent, changing fleet defaults, or altering agent-tool account precedence.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d2d2594b0d2a.

Labels

Label changes:

  • add P2: Repairs GitHub connection status for multi-agent Gateways without a default, with a bounded effect on optional account management.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored repair is exempt from the external-contributor proof gate and introduces no material authority change. Its captured body nevertheless reports the changed status endpoint succeeding through a real authenticated Gateway/WebSocket with two agents and no default.

Label justifications:

  • P2: Repairs GitHub connection status for multi-agent Gateways without a default, with a bounded effect on optional account management.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored repair is exempt from the external-contributor proof gate and introduces no material authority change. Its captured body nevertheless reports the changed status endpoint succeeding through a real authenticated Gateway/WebSocket with two agents and no default.

Evidence

What I checked:

  • Current-main failure remains: The status handler still calls resolveDefaultAgentId before reading either account. src/agents/agent-scope-config.ts resolves an unmarked multi-agent roster through resolveSoleAgentId, which throws AgentSelectionRequiredError. (src/gateway/server-methods/users-github.ts:65, d2d2594b0d2a)
  • Latest release remains affected: The supplied latest release, v2026.9.1, contains the same default-agent call; its agent-scope implementation also rejects multiple agents without a selected owner. (src/gateway/server-methods/users-github.ts:65, ad6fe23aecb9)
  • Repair belongs at the status owner: The new system-status entry point reuses system credential selection and probes author facts in the Gateway state directory. Agent-aware status retains workspace probing and separate selected/effective identities. This path uses OpenClaw's GitHub and process helpers; it does not invoke a Codex runtime or protocol. (src/agents/github-tool-identity.ts:358, 758ac6402c8c)
  • Existing caller and protocol contract: The status request schema accepts an empty object and returns personal/system facts. The Profile controller already sends that empty request, and the connection view can display the returned system facts without an agent-specific status response. (packages/gateway-protocol/src/schema/users.ts:357, 758ac6402c8c)
  • Focused regression coverage: Two cases exercise the real Gateway request dispatcher with a multi-agent roster and no default, covering native and managed system accounts. They assert both returned accounts, exclude an unrelated agent credential probe, and require the Gateway state directory for the author probe. Network and subprocess operations are mocked; these are supplemental regression tests. (src/gateway/server-methods/users-github.test.ts:220, 758ac6402c8c)
  • Sibling behavior and authorization preserved: Existing identity tests cover agent-override precedence, selected versus effective accounts, managed-profile failure without native fallback, and workspace-specific author probing. The personal RPC wrapper still validates the authenticated owner before execution and rechecks current authority before returning an asynchronous result. (src/gateway/server-methods/users-github.ts:44, 758ac6402c8c)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 9e79197 into main Sep 5, 2026
184 checks passed
@steipete
steipete deleted the codex/github-status-system-scope branch September 5, 2026 17:16
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to aniruddhaadak80/openclaw that referenced this pull request Sep 5, 2026
* commit '3e4becea5e2ce38ede69e8ecf5302805ecbfc09c':
  refactor: simplify outbound message execution context (openclaw#139107)
  fix(models): keep ordinary chat selections session-scoped (openclaw#139232)
  docs: slim root agent instructions and clarify testing scope (openclaw#139236)
  test(agents): give the sibling-drain completion wait a tolerance on slow runners (openclaw#139176)
  refactor(workboard): use canonical queries for card-tree writes (openclaw#139106)
  fix(canvas): recognize versioned macOS nodes (openclaw#138958)
  fix: load GitHub connections without a default agent (openclaw#139222)
  fix(memory): explain unsafe legacy host-event path recovery (openclaw#139195)
  refactor(talk): centralize typed voice session queries (openclaw#139103)
  fix(cli): preserve command dispatch and structured errors (openclaw#139067)
  refactor(agents): consolidate reply failure summaries (openclaw#139175)
  fix(auth): keep an unset default model unchanged during login (openclaw#139218)
  perf(media): reuse validated attachment read handles (openclaw#139168)
  refactor(channels): simplify account configuration updates (openclaw#139096)
  refactor(android): remove unused updater export root (openclaw#139198)
  fix(gateway): stop admitting post-ready producers during close (openclaw#139092)
  fix(gateway): expose agent hook completion outcomes (openclaw#139155)
  fix(config): return the saved configuration after plugin install commits (openclaw#139203)
  fix(android): reduce repeated retries to unreachable gateways (openclaw#138732)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 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 docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant