[codex] Support OpenClaw gateway password auth fallback#494
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Improves OpenClaw gateway interoperability by adding password-mode authentication fallback, expanding unauthenticated health/diagnostic detection, and aligning UI/settings copy and tests with the updated auth behavior.
Changes:
- Add retry logic to fall back from token-style shared-secret auth to
auth.passwordwhen the gateway indicates password-mode failures. - Expand health/test diagnostics to treat password-missing/password-mismatch detail codes as unauthenticated and to surface better hints.
- Update settings/SME/provider metadata copy and add/adjust Vitest coverage for the new auth behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/web/src/routes/_chat.settings.index.tsx | Updates OpenClaw settings UI copy to reflect shared-secret auth fallback behavior. |
| apps/web/src/lib/settingsProviderMetadata.tsx | Aligns OpenClaw provider auth guidance copy with shared-secret + password/token fallback. |
| apps/web/src/lib/settingsProviderMetadata.test.ts | Updates expectations for OpenClaw provider auth guide text. |
| apps/web/src/components/sme/smeConversationConfig.ts | Updates OpenClaw auth option labels to match new terminology. |
| apps/web/src/components/sme/smeConversationConfig.test.ts | Updates SME auth option label expectations. |
| apps/server/src/provider/Layers/ProviderHealth.ts | Adds helper to classify additional OpenClaw unauthenticated detail codes; uses it in health check. |
| apps/server/src/provider/Layers/ProviderHealth.test.ts | Adds unit coverage for the new unauthenticated detail-code helper. |
| apps/server/src/provider/Layers/OpenClawGatewayClient.ts | Implements shared-secret token→password fallback and refactors auth selection logic. |
| apps/server/src/openclawGatewayTest.ts | Extends gateway test hinting to include password missing/mismatch codes. |
| apps/server/src/openclawGatewayTest.test.ts | Adds coverage for password-style retry and password-missing hinting. |
| apps/server/src/openclaw/GatewayClient.ts | Adds password-mode fallback in the OpenclawGatewayClient connect handshake. |
| apps/server/src/openclaw/GatewayClient.test.ts | New test validating retry to auth.password when token-style is rejected. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Retry shared-secret connections with password-style auth when required - Update health checks, hints, and settings copy for gateway auth mode
- preserve the thrown auth failure for the fallback path - tighten the auth payload test typing
7af6b7b to
fafa886
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
auth.passwordwhen the gateway rejects token-style authRoot Cause
OK Code only forwarded the saved OpenClaw shared secret as
auth.tokenduring theconnecthandshake. Password-mode gateways requireauth.password, so connection tests and health probes failed withAUTH_PASSWORD_MISSINGeven when the shared secret was configured.Testing
bun run --cwd apps/server test -- src/openclawGatewayTest.test.ts src/openclaw/GatewayClient.test.ts src/provider/Layers/ProviderHealth.test.tsbun run --cwd apps/web test -- src/components/sme/smeConversationConfig.test.ts src/lib/settingsProviderMetadata.test.tsbun fmtbun lintbun typecheck