MCPcopy Index your code
hub / github.com/docker/docker-agent / joinPrompts

Function joinPrompts

pkg/runtime/runtime.go:1904–1913  ·  view source on GitHub ↗

joinPrompts concatenates two non-empty prompt fragments with a blank line, returning whichever is non-empty when the other isn't. Used by compactWithReason to splice pre_compact's additional_context into the caller's additionalPrompt without having to special-case empty strings at the callsite.

(a, b string)

Source from the content-addressed store, hash-verified

1902// the caller's additionalPrompt without having to special-case empty
1903// strings at the callsite.
1904func joinPrompts(a, b string) string {
1905 switch {
1906 case a == "":
1907 return b
1908 case b == "":
1909 return a
1910 default:
1911 return a + "\n\n" + b
1912 }
1913}

Callers 1

compactWithReasonMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected