Skip to content

thv llm setup: gateway URL not validated for HTTPS scheme (inconsistent with config set) #5125

@yrobla

Description

@yrobla

Problem

thv llm config set --gateway-url correctly validates that the URL uses the https scheme:

if u.Scheme != "https" {
    return fmt.Errorf("gateway URL must use HTTPS: %s", llmConfigGatewayURL)
}

However, thv llm setup --gateway-url calls applySetupFlags, which writes the URL directly to config without any scheme validation. This means a user can accidentally configure an http:// gateway via setup, then hit a confusing error later at proxy creation time (inside llm.NewProxy).

Expected behavior

applySetupFlags (or newLLMSetupCmd's RunE) should apply the same HTTPS validation as llmConfigSetFunc when --gateway-url is changed.

Acceptance Criteria

  • thv llm setup --gateway-url http://... returns an error: "gateway URL must use HTTPS"
  • Validation is consistent between thv llm config set and thv llm setup

References

  • cmd/thv/app/llm.gollmConfigSetFunc (has validation) vs applySetupFlags (no validation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliChanges that impact CLI functionalitygoPull requests that update go codellm gatewayLLM gateway authentication feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions