MCPcopy Index your code
hub / github.com/coder/coder / truncateRunes

Function truncateRunes

coderd/x/chatd/quickgen.go:621–630  ·  view source on GitHub ↗
(value string, maxLen int)

Source from the content-addressed store, hash-verified

619}
620
621func truncateRunes(value string, maxLen int) string {
622 if maxLen <= 0 {
623 return ""
624 }
625 runes := []rune(value)
626 if len(runes) <= maxLen {
627 return value
628 }
629 return string(runes[:maxLen])
630}
631
632// Manual title regeneration is user-initiated and can use richer
633// conversation context than the automatic first-message title path

Callers 8

normalizeTitleOutputFunction · 0.70
fallbackChatTitleFunction · 0.70
buildManualTitleContextFunction · 0.70
renderManualTitlePromptFunction · 0.70
generateManualTitleFunction · 0.70

Calls

no outgoing calls