sourcegraph / cody

Type less, code more: Cody is an AI code assistant that uses advanced search and codebase context to help you write and fix code.
https://cody.dev
Apache License 2.0
2.6k stars 278 forks source link

Refine preamble for general coding questions #4573

Closed jtibshirani closed 3 months ago

jtibshirani commented 3 months ago

Follow up to #4516. In dogfooding, we noticed the new "context preamble" made Claude too cautious to answer general coding questions when other context was provided. This PR refines the prompt to strike a better balance between grounding answers in context, while still responding to general questions.

Example: "how do slices in go work?", Claude 3 Sonnet with codebase context

Test plan

Added several more "Chat quality" unit tests

jtibshirani commented 3 months ago

Thanks for the review! I'll merge in latest main and check tests pass.