Chat connection errors print the raw gateway URL

Aperta Adatta ai principianti
#2,006 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
84/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
desktop, security

Direzione di ricerca

Leggi i due punti di chiamata in src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml.cs intorno alle righe 1008 e 1178, poi cerca i test per ChatPage o GatewayUrlHelper. Passa GatewayUrlHelper.SanitizeForDisplay a entrambe le stringhe di formato dei messaggi di errore e aggiungi test di regressione che dimostrino che la query del gateway è assente da ciascun messaggio. Il lavoro è completato quando entrambi gli errori mostrano un URL sanificato e i test passano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

clawsweeper:needs-security-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:security issue-rating: 🦞 diamond lobster P2

What happens

When web chat cannot connect, the page prints credential.GatewayUrl in the error text. An invalid gateway URL is also placed in the error text before the chat URL is built. Direct connect keeps a query and a fragment on that URL, so a token there is shown. GatewayUrlHelper.SanitizeForDisplay is not used on either string.

The pairing and connected messages on the Connection page already pass the URL through that helper.

Where

Checked on 7967d509 by reading the code. Chat was not opened against a failing gateway.

Suggested fix

Show the sanitized gateway URL in both messages.

Environment

Windows 11. OpenClaw Companion source on main at commit 7967d509886fc9efecbb19c8236350a82867f69c (2026-11-04). No packaged installer build was used.

Steps

  1. Save a gateway URL that web chat cannot open, and include a query on that URL.
  2. Open Chat.
  3. Read the cannot-connect line. The invalid-URL path prints the same raw string.

ChatPage line 1008 formats ChatPage_CannotConnectToGateway with credential.GatewayUrl. TryBuildChatUrl line 1181 formats ChatPage_InvalidGatewayUrl with the raw gateway URL.

Repair

Pass GatewayUrlHelper.SanitizeForDisplay into both format strings. Add a regression that a query on the gateway URL is absent from both error strings. Stop there. This is not the Connection Status list (#2001).

Lingua principale
C#
Stelle
2.2k
Fork
340
Merge medio
3g 3h
PR unite (30g)
168

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openclaw/openclaw-windows-node

Tutte le issue di openclaw/openclaw-windows-node

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.