MCPcopy Create free account
hub / github.com/diillson/chatcli / truncatePlannerOutput

Function truncatePlannerOutput

cli/agent_plan_first.go:156–162  ·  view source on GitHub ↗

truncatePlannerOutput keeps Plan-First diagnostics bounded so a runaway planner can't flood the logs.

(s string, n int)

Source from the content-addressed store, hash-verified

154// truncatePlannerOutput keeps Plan-First diagnostics bounded so a
155// runaway planner can't flood the logs.
156func truncatePlannerOutput(s string, n int) string {
157 r := []rune(s)
158 if len(r) <= n {
159 return s
160 }
161 return string(r[:n]) + "..."
162}
163
164// renderPlanPreview pretty-prints the planner's JSON output for the
165// /plan preview (dry-run) mode. Falls back to the raw JSON when

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected