mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
fix(coderd/x/chatd): document quickgen prompt shape
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user