Tray gateway menu and Local AI page show the raw gateway URL

Đang mở Phù hợp với người mới
#2,004 2 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
desktop

Hướng nghiên cứu

Bắt đầu với BuildGatewayFlyout trong TrayMenuPresenter.cs và GatewayDetail trong LocalAiPageViewModel.cs, sau đó kiểm tra GatewayUrlHelper.SanitizeForDisplay. Dùng URL đã lưu và được làm sạch cho phần chi tiết flyout và phương án dự phòng của Local AI, đồng thời giữ tên thân thiện nếu có. Bổ sung kiểm thử hồi quy cho thấy query của URL đã lưu không xuất hiện trong cả hai chuỗi; hoàn tất khi cả hai vị trí đều vượt qua kiểm thử.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

What happens

The tray gateway flyout puts Uri.ToString() of the saved gateway URL in the card detail. That string keeps userinfo, the query, and the fragment. The card title already shows host and port, so the detail is a second, fuller copy.

The Local AI page shows the same saved URL when the gateway has no friendly name. Direct connect stores the URL after NormalizeForWebSocket, which removes userinfo and leaves the query and fragment. GatewayUrlHelper.SanitizeForDisplay is not used on either surface.

Where

Checked on 7967d509 by reading the code. The tray and Local AI page were not opened.

Suggested fix

Display GatewayUrlHelper.SanitizeForDisplay of the saved URL in both places. Prefer the friendly name on Local AI when one exists, and use the sanitized URL only as the fallback.

Environment

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

Steps

  1. Direct-connect a gateway URL that still has a query, and leave the friendly name empty.
  2. Open the tray gateway menu and read the card detail.
  3. Open Local AI and read the gateway line.

TrayMenuPresenter.BuildGatewayFlyout sets the detail to gatewayUri.ToString(). LocalAiPageViewModel.GatewayDetail falls back to GatewayUrl when GatewayName is empty. The card title already shows host and port.

Repair

Use GatewayUrlHelper.SanitizeForDisplay for the flyout detail and for the Local AI fallback. Add a regression that a query on the saved URL does not appear in either string. Stop there. This is not the Connection Status list (#2001) or the chat error (#2006).

Ngôn ngữ chính
C#
Star
2.2k
Fork
340
Merge trung bình
3 ngày 3 giờ
Pull request đã merge (30 ngày)
168

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của openclaw/openclaw-windows-node

Tất cả issue của openclaw/openclaw-windows-node

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.