Continue appears to rewrite a configured localhost API base URL to 127.0.0.1. (WSL)

Đang mở
#13,339 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

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

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/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ệ
typescript
Lĩnh vực
backend, networking

Hướng nghiên cứu

The report shows Continue requesting http://127.0.0.1:8080/completion even though apiBase is configured as http://localhost:8080, while http://[::1]:8080 works. Reproduce with the llama.cpp provider config given, then find where an apiBase URL is normalized, since the config is being rewritten before the request is built. Done looks like the user-supplied hostname being preserved so the request goes to localhost:8080/completion.

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

Mô tả

Before submitting your bug report
Relevant environment info
OS: Windows with WSL2 (Ubuntu)
Continue version: V2.0.0
IDE version: VS Code 1.140.0
Model: Qwen3 14B, llama.cpp, ROCm

config:

models:
  - name: Qwen3 14B (llama-rocm)
    provider: llama.cpp
    model: /models/Qwen3-14B-Q4_K_M.gguf
    apiBase: http://localhost:8080
    roles:
      - chat
      - edit
      - apply
    defaultCompletionOptions:
      temperature: 0.2
      maxTokens: 4096
Description

Continue appears to replace an explicitly configured localhost API base with 127.0.0.1.

My llama.cpp server is reachable through localhost and IPv6 loopback, but not through IPv4 loopback:

curl http://localhost:8080/health
# works

curl http://[::1]:8080/health
# works

curl http://127.0.0.1:8080/health
# fails

Continue is explicitly configured with:

apiBase: http://localhost:8080

However, when Continue attempts a completion, the error shows a request being made to:

http://127.0.0.1:8080/completion

This causes the request to fail with ECONNREFUSED.

The issue appears to be that Continue is replacing localhost with 127.0.0.1 instead of preserving the user-provided hostname and allowing the operating system or runtime to resolve it.

Using IPv6 explicitly works around the issue:

apiBase: http://[::1]:8080

With that configuration, Continue can connect to the llama.cpp server successfully.

Expected behavior

If apiBase is explicitly configured as:

http://localhost:8080

Continue should preserve that hostname and connect to:

http://localhost:8080/completion

It should not rewrite localhost to 127.0.0.1.

localhost and 127.0.0.1 are not always interchangeable, particularly in environments involving WSL2, IPv6, containers, and virtualized networking.

To reproduce
  1. Run a llama.cpp server that is reachable through localhost and ::1, but not through 127.0.0.1.

  2. Verify the endpoints:

curl http://localhost:8080/health
curl http://[::1]:8080/health
curl http://127.0.0.1:8080/health
  1. Configure Continue with:
models:
  - name: Qwen3 14B (llama-rocm)
    provider: llama.cpp
    model: /models/Qwen3-14B-Q4_K_M.gguf
    apiBase: http://localhost:8080
    roles:
      - chat
      - edit
      - apply
  1. Select the model in Continue and send a chat request.

  2. Observe that Continue attempts to connect to:

http://127.0.0.1:8080/completion

rather than:

http://localhost:8080/completion
  1. Change the configuration to:
apiBase: http://[::1]:8080
  1. Retry the request and observe that it succeeds.
Log output
request to http://127.0.0.1:8080/completion failed, reason: connect ECONNREFUSED 127.0.0.1:8080
Ngôn ngữ chính
TypeScript
Star
36.5k
Fork
5.6k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

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 continuedev/continue

Tất cả issue của continuedev/continue

Issue tương tự

Thêm issue về TypeScript

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.