Skip to content

[Bug]: proxy redirects are reported as HTTP 500 #548

Description

@aydin-aghaliyev

Prerequisites

  • I have searched existing issues to avoid duplicates.
  • I am using the latest version of CodeMie CLI.

Bug Description

When CodeMie CLI is used behind an authenticated enterprise HTTPS proxy, an
assistant-list request fails. The CLI reports API error: HTTP 500 error, but
the underlying Axios error is ERR_FR_TOO_MANY_REDIRECTS.

The same authenticated API request succeeds with curl through the same proxy.
This makes the CLI unusable in this common enterprise-network configuration.

Steps to Reproduce

  1. Configure an AI/Run SSO profile that can list assistants.

  2. Use an HTTPS API deployment reachable only through an enterprise HTTP proxy.

  3. Export both HTTP_PROXY and HTTPS_PROXY to the same proxy URL.

  4. Run:

    codemie sdk assistants list --projects example-project --page 0 --per-page 5 --json
  5. The CLI reports API error: HTTP 500 error.

Expected Behavior

The CLI should return the assistant list through the configured HTTPS proxy, or
surface the actual proxy/redirect error rather than misclassifying it as HTTP
500.

Actual Behavior

The SDK sends the expected request to /v1/assistants with the expected
visible_to_user scope and project filter. Removing the SDK response error
wrapper shows:

Error [ERR_FR_TOO_MANY_REDIRECTS]
Maximum number of redirects exceeded

Stopping redirects after the first response shows a 301 redirect to the same
resource with an explicit :443 authority. Following it through the proxy
loops. The SDK catches the network error with no HTTP response and converts it
to the misleading generic message HTTP 500 error.

By contrast, an authenticated curl request through the same proxy returns HTTP
200 and JSON from /v1/assistants.

Environment

  • CodeMie CLI: 0.15.1
  • Bundled codemie-sdk: 0.1.613
  • Node.js: v24.15.0
  • OS: Windows WSL2 (Linux guest)
  • Provider: AI/Run SSO

Configuration (Redacted)

{
  "version": 2,
  "activeProfile": "default",
  "profiles": {
    "default": {
      "provider": "ai-run-sso",
      "baseUrl": "https://[redacted]/code-assistant-api"
    }
  }
}

Suggested areas to investigate

  • Axios/follow-redirects behavior when HTTPS_PROXY is set.
  • Interaction between the SDK's custom httpsAgent and environment proxy
    support.
  • Preserve the original transport error rather than converting missing-response
    errors into HTTP 500 error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions