Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Add some logging for modelconfig problems #64310

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chrsmith
Copy link
Contributor

@chrsmith chrsmith commented Aug 6, 2024

I spent some time trying to troubleshoot why I wasn't getting the expected results from modelconfig. And it turns out, that there are some codepaths where conf.GetCompletionsConfig(siteConfig) returns nil but without any other sort of notification.

e.g. if you are using azure-openai and do not specify the endpoint field, computed.go will just bail rather than supply a default.

		// If no endpoint is configured, this provider is misconfigured.
		if completionsConfig.Endpoint == "" {
			return nil
		}

		// If not chat model is set, we cannot talk to Azure OpenAI. Bail.
		if completionsConfig.ChatModel == "" {
			return nil
		}

This should probably just be a site configuration error, since otherwise Cody Enterprise won't work correctly. (Now with the modelconfig, we will act as if no site configuration was supplied at all and default to just using the statically embedded models, which is fairly surprising.)

Anyways, this PR just adds some logging to make this easier to track down if it happens again. I don't know how much time we would want to spend preventing errors for the "completions" config since.

Test plan

NA

Changelog

NA

@chrsmith chrsmith requested a review from a team August 6, 2024 19:06
@cla-bot cla-bot bot added the cla-signed label Aug 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant