@@ -55,6 +55,8 @@ const (
55 smallContextWindowRatio = 0.2
55 smallContextWindowRatio = 0.2
58+var userAgent = fmt.Sprintf("Charm-Crush/%s (https://charm.land/crush)", version.Version)
58//go:embed templates/title.md
60//go:embed templates/title.md
59var titlePrompt []byte
61var titlePrompt []byte
@@ -201,7 +203,7 @@ func (a *sessionAgent) Run(ctx context.Context, call SessionAgentCall) (*fantasy
201 largeModel.Model,
203 largeModel.Model,
202 fantasy.WithSystemPrompt(systemPrompt),
204 fantasy.WithSystemPrompt(systemPrompt),
203 fantasy.WithTools(agentTools...),
205 fantasy.WithTools(agentTools...),
204− fantasy.WithUserAgent("Charm Crush/"+version.Version),
206+ fantasy.WithUserAgent(userAgent),
207 sessionLock := sync.Mutex{}
209 sessionLock := sync.Mutex{}
@@ -610,7 +612,7 @@ func (a *sessionAgent) Summarize(ctx context.Context, sessionID string, opts fan
611 agent := fantasy.NewAgent(largeModel.Model,
613 agent := fantasy.NewAgent(largeModel.Model,
612 fantasy.WithSystemPrompt(string(summaryPrompt)),
614 fantasy.WithSystemPrompt(string(summaryPrompt)),
613− fantasy.WithUserAgent("Charm Crush/"+version.Version),
615+ fantasy.WithUserAgent(userAgent),
615 summaryMessage, err := a.messages.Create(ctx, sessionID, message.CreateMessageParams{
617 summaryMessage, err := a.messages.Create(ctx, sessionID, message.CreateMessageParams{
616 Role: message.Assistant,
618 Role: message.Assistant,
@@ -806,7 +808,7 @@ func (a *sessionAgent) generateTitle(ctx context.Context, sessionID string, user
806 return fantasy.NewAgent(m,
808 return fantasy.NewAgent(m,
807 fantasy.WithSystemPrompt(string(p)+"\n /no_think"),
809 fantasy.WithSystemPrompt(string(p)+"\n /no_think"),
808 fantasy.WithMaxOutputTokens(tok),
810 fantasy.WithMaxOutputTokens(tok),
809− fantasy.WithUserAgent("Charm Crush/"+version.Version),
811+ fantasy.WithUserAgent(userAgent),