chore: update user-agent string to better follow the convention

Andrey Nering created

* No spaces in app name: `Charm Crush` -> `Charm-Crush`
* Add link to project as a comment `()`

Change summary

internal/agent/agent.go | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Detailed changes

internal/agent/agent.go 🔗

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