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

Function subagentTruncateRunes

coderd/x/chatd/subagent.go:1534–1545  ·  view source on GitHub ↗
(value string, maxRunes int)

Source from the content-addressed store, hash-verified

1532}
1533
1534func subagentTruncateRunes(value string, maxRunes int) string {
1535 if maxRunes <= 0 {
1536 return ""
1537 }
1538
1539 runes := []rune(value)
1540 if len(runes) <= maxRunes {
1541 return value
1542 }
1543
1544 return string(runes[:maxRunes])
1545}
1546
1547func toolJSONResponse(result map[string]any) fantasy.ToolResponse {
1548 data, err := json.Marshal(result)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected