Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit537d2e9

Browse files
committed
fix(ui): limit session name to 32 characters in NewSketchAction
Truncate the session name content to prevent overly long session names in the chat history.
1 parent6a0063a commit537d2e9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎core/src/main/kotlin/cc/unitmesh/devti/gui/toolbar/NewSketchAction.kt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ class NewSketchAction : AnAction(AllIcons.General.Add), CustomComponentAction {
6161
if (messages.isNotEmpty()) {
6262
val timestamp=SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.getDefault()).format(Date())
6363
val firstUser= messages.firstOrNull { it.role.lowercase()=="user" }
64-
val sessionName="Session -${firstUser?.content?: timestamp}"
64+
val limit= (firstUser?.content?: timestamp).toString().take(32)
65+
val sessionName="Session -$limit"
6566
chatHistoryService.saveSession(sessionName, messages)
6667
logger.info("Saved session:$sessionName")
6768
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp