Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant