MCPcopy Index your code
hub / github.com/codehamr/codehamr / onlyNonSubstantive

Function onlyNonSubstantive

internal/ctx/ctx.go:300–311  ·  view source on GitHub ↗

onlyNonSubstantive reports whether kept carries no substantive conversation: only system-role notes (soft nudges) and empty assistant messages (no text, no tool calls - the stall shape the empty-reply nudge answers, appended right before that nudge). Vacuously true for an empty slice.

(kept []Message)

Source from the content-addressed store, hash-verified

298// only system-role notes (soft nudges) and empty assistant messages (no text,
299// no tool calls - the stall shape the empty-reply nudge answers, appended
300// right before that nudge). TrimSpace matches tui.newestAssistantEmpty's
301// definition of "empty", so a whitespace-only stall can't mask the recovery.
302// Vacuously true for an empty slice.
303func onlyNonSubstantive(kept []Message) bool {
304 for _, m := range kept {
305 if m.Role == RoleSystem {
306 continue
307 }
308 if m.Role == RoleAssistant && strings.TrimSpace(m.Content) == "" && len(m.ToolCalls) == 0 {
309 continue
310 }
311 return false
312 }
313 return true
314}

Callers 1

PackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected