Skip to content

Commit f621834

Browse files
authored
feat: Auto-generate and edit session display names (#432)
## Summary Two-part feature for session display name management: ### 1. Auto-Generate Display Names When users send their first message in a session, the backend automatically generates a descriptive display name using Claude Haiku. - Triggers on first user message when `displayName` is empty - Uses session context (repos, workflow) to generate relevant names - Runs asynchronously - fails silently with logging on error - Supports both Anthropic API (via project secret) and Google Vertex AI ### 2. Manual Name Editing Added UI controls to edit session names: - "Edit name" option in session detail page kebab menu - "Edit name" option in sessions list actions dropdown - Simple modal dialog for editing ### Backend Changes - Added `handlers/display_name.go` with Claude Haiku integration - Added `PUT /api/projects/:projectName/agentic-sessions/:sessionName/displayname` endpoint - Modified `PostSessionMessageWS` to trigger auto-generation - Added Anthropic Go SDK with Vertex AI support ### Frontend Changes - Added `EditSessionNameDialog` component - Added `useUpdateSessionDisplayName` React Query mutation - Added Next.js API proxy route for display name updates - Updated `session-header.tsx` and `sessions-section.tsx` with edit buttons ### Testing - Tested manual name editing via UI - Verified backend deployment with Vertex AI authentication fix
1 parent afe930e commit f621834

File tree

12 files changed

+937
-31
lines changed

12 files changed

+937
-31
lines changed

components/backend/go.mod

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.24.0
55
toolchain go1.24.7
66

77
require (
8+
github.com/anthropics/anthropic-sdk-go v1.2.0
89
github.com/gin-contrib/cors v1.7.6
910
github.com/gin-gonic/gin v1.10.1
1011
github.com/golang-jwt/jwt/v5 v5.3.0
@@ -18,15 +19,20 @@ require (
1819
)
1920

2021
require (
22+
cloud.google.com/go/auth v0.7.2 // indirect
23+
cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect
24+
cloud.google.com/go/compute/metadata v0.5.0 // indirect
2125
github.com/bytedance/sonic v1.13.3 // indirect
2226
github.com/bytedance/sonic/loader v0.2.4 // indirect
2327
github.com/cloudwego/base64x v0.1.5 // indirect
2428
github.com/davecgh/go-spew v1.1.1 // indirect
2529
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
30+
github.com/felixge/httpsnoop v1.0.4 // indirect
2631
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
2732
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
2833
github.com/gin-contrib/sse v1.1.0 // indirect
2934
github.com/go-logr/logr v1.4.2 // indirect
35+
github.com/go-logr/stdr v1.2.2 // indirect
3036
github.com/go-openapi/jsonpointer v0.21.0 // indirect
3137
github.com/go-openapi/jsonreference v0.20.2 // indirect
3238
github.com/go-openapi/swag v0.23.0 // indirect
@@ -35,7 +41,11 @@ require (
3541
github.com/go-playground/validator/v10 v10.26.0 // indirect
3642
github.com/goccy/go-json v0.10.5 // indirect
3743
github.com/gogo/protobuf v1.3.2 // indirect
44+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
45+
github.com/golang/protobuf v1.5.4 // indirect
3846
github.com/google/gnostic-models v0.7.0 // indirect
47+
github.com/google/s2a-go v0.1.7 // indirect
48+
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
3949
github.com/josharian/intern v1.0.0 // indirect
4050
github.com/json-iterator/go v1.1.12 // indirect
4151
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
@@ -49,19 +59,33 @@ require (
4959
github.com/pkg/errors v0.9.1 // indirect
5060
github.com/pmezard/go-difflib v1.0.0 // indirect
5161
github.com/spf13/pflag v1.0.6 // indirect
62+
github.com/tidwall/gjson v1.14.4 // indirect
63+
github.com/tidwall/match v1.1.1 // indirect
64+
github.com/tidwall/pretty v1.2.1 // indirect
65+
github.com/tidwall/sjson v1.2.5 // indirect
5266
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
5367
github.com/ugorji/go/codec v1.3.0 // indirect
5468
github.com/x448/float16 v0.8.4 // indirect
69+
go.opencensus.io v0.24.0 // indirect
70+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
71+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
72+
go.opentelemetry.io/otel v1.24.0 // indirect
73+
go.opentelemetry.io/otel/metric v1.24.0 // indirect
74+
go.opentelemetry.io/otel/trace v1.24.0 // indirect
5575
go.yaml.in/yaml/v2 v2.4.2 // indirect
5676
go.yaml.in/yaml/v3 v3.0.4 // indirect
5777
golang.org/x/arch v0.18.0 // indirect
5878
golang.org/x/crypto v0.45.0 // indirect
5979
golang.org/x/net v0.47.0 // indirect
6080
golang.org/x/oauth2 v0.27.0 // indirect
81+
golang.org/x/sync v0.18.0 // indirect
6182
golang.org/x/sys v0.38.0 // indirect
6283
golang.org/x/term v0.37.0 // indirect
6384
golang.org/x/text v0.31.0 // indirect
6485
golang.org/x/time v0.9.0 // indirect
86+
google.golang.org/api v0.189.0 // indirect
87+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade // indirect
88+
google.golang.org/grpc v1.64.1 // indirect
6589
google.golang.org/protobuf v1.36.6 // indirect
6690
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
6791
gopkg.in/inf.v0 v0.9.1 // indirect

components/backend/go.sum

Lines changed: 118 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)