fix(coderd/x/chatd): document quickgen prompt shape

This commit is contained in:
Michael Suchacz
2026-05-28 12:42:55 +00:00
parent 2931755cbf
commit 546d736407
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -424,6 +424,8 @@ func (p *Server) prepareQuickgenDebugCandidate(
return runCtx, debugModel, finishDebugRun
}
// Synthetic quickgen prompts end with an assistant marker because AI Bridge
// records final user-role messages as user prompts.
const quickgenStructuredOutputReady = "Ready to provide the structured output."
func syntheticObjectGenerationPrompt(systemPrompt, userInput string) fantasy.Prompt {
+1
View File
@@ -526,6 +526,7 @@ func Test_generateManualTitle_TruncatesFirstUserInput(t *testing.T) {
model := &chattest.FakeModel{
GenerateObjectFn: func(_ context.Context, call fantasy.ObjectCall) (*fantasy.ObjectResponse, error) {
requireSyntheticQuickgenPrompt(t, call.Prompt, truncateRunes(longFirstUserText, 1000))
// The manual title system prompt also includes the latest user excerpt.
systemText, ok := call.Prompt[0].Content[0].(fantasy.TextPart)
require.True(t, ok)
require.Contains(t, systemText.Text, truncateRunes(longFirstUserText, 1000))