Surface pending scope upgrades in gateway auth errors#69226
Surface pending scope upgrades in gateway auth errors#69226obviyus merged 8 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR surfaces structured pairing-rejection details (scope/role/metadata upgrade reasons and Confidence Score: 5/5Safe to merge — changes are additive, well-tested, and handle all existing pairing code paths correctly. All findings are P2. The logic for the new resolvePairingHint/readConnectPairingRequiredMessage round-trip is correct and backward-compatible; existing shouldShowPairingHint callers are unaffected. requestId sanitisation is validated by a dedicated test. Coverage includes unit tests for all new branches plus integration tests for the UI rendering. No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: ui/src/ui/views/overview-hints.ts
Line: 45-60
Comment:
**Fallback `null` for unknown `reason` maps to `"pairing-required"`**
When `readConnectPairingRequiredMessage` returns a truthy object but `reason` is undefined (can happen if `resolvePairingRequiredReasonFromMessage` falls through its last `"pairing required"` branch and returns `"not-paired"`, or future server-sent reasons that don't match any known value), the ternary chain falls through to `"pairing-required"` — which is the correct safe default and matches the existing `PAIRING_HINT_COPY` entry. No action needed, but it's worth a comment that this is intentional, since the type `PairingHint["kind"]` doesn't include an explicit `null`/`unknown` arm.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(control-ui): show scope upgrade pend..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b11d47f41
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b672de2 to
ad73956
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad7395687c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21dd622b8d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
21dd622 to
0520e89
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 018dd966d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 758ebe7fd6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| settleProbe({ | ||
| ok: false, | ||
| error: formatProbeCloseError(close), | ||
| error: connectError || formatProbeCloseError(close), |
There was a problem hiding this comment.
Detect pairing-pending from surfaced connect errors
This branch now prefers connectError, so pairing rejections can surface as messages like scope upgrade pending approval ... even when the close reason is generic (connect failed). However, probe capability classification still prioritizes close.reason in isPairingPendingProbeFailure, so these cases are reported as generic failures instead of pairing_pending, which suppresses pairing-specific recovery UX in probe/daemon status flows.
Useful? React with 👍 / 👎.
| if (readConnectErrorDetailCode(params.details) === ConnectErrorDetailCodes.PAIRING_REQUIRED) { | ||
| return formatConnectPairingRequiredMessage(params.details); |
There was a problem hiding this comment.
Preserve server text when pairing details are partial
This unconditional rewrite for PAIRING_REQUIRED drops the original server message and always formats from structured details; if reason/requestId are missing (both are optional in PairingConnectErrorDetails), the output collapses to a generic device pairing required. That loses actionable upgrade context from message text and can remove request-id guidance that callers parse from error strings.
Useful? React with 👍 / 👎.
* 'main' of https://github.com/openclaw/openclaw: (38 commits) fix(ui): restore pairing connect error formatting chore(ui): refresh pl control ui locale chore(ui): refresh id control ui locale chore(ui): refresh uk control ui locale chore(ui): refresh tr control ui locale chore(ui): refresh fr control ui locale chore(ui): refresh ko control ui locale chore(ui): refresh ja-JP control ui locale chore(ui): refresh es control ui locale chore(ui): refresh pt-BR control ui locale chore(ui): refresh de control ui locale chore(ui): refresh zh-CN control ui locale chore(ui): refresh zh-TW control ui locale fix: avoid preview-only pairing approval hint (openclaw#69226) fix: surface pending scope upgrade feedback (openclaw#69226) fix(ui): localize pairing upgrade hint copy fix(agents): preserve pairing guidance for node invoke upgrades test(cli): align probe status expectation after rebase fix(cli): preserve local pairing fallback for upgrades fix(control-ui): show scope upgrade pending state ...
Summary
When a paired read-only device reconnects asking for wider operator scopes, surface the real approval state instead of a generic pairing/auth failure.
Changes
Verification