MCPcopy Index your code
hub / github.com/anomalyco/opencode / redactBody

Function redactBody

packages/llm/src/route/executor.ts:191–195  ·  view source on GitHub ↗
(body: string, request: HttpClientRequest.HttpClientRequest)

Source from the content-addressed store, hash-verified

189// for any field name that looks sensitive) plus literal (replace any actual
190// secret values we sent in the request, in case the response echoes one back).
191const redactBody = (body: string, request: HttpClientRequest.HttpClientRequest) =>
192 Array.from(secretValues(request)).reduce(
193 (text, secret) => text.split(secret).join(REDACTED),
194 body.replace(REDACT_JSON_FIELD, `$1"${REDACTED}"`).replace(REDACT_QUERY_FIELD, `$1${REDACTED}`),
195 )
196
197const responseBody = (body: string | void, request: HttpClientRequest.HttpClientRequest) => {
198 if (body === undefined) return {}

Callers 1

responseBodyFunction · 0.70

Calls 2

secretValuesFunction · 0.85
fromMethod · 0.45

Tested by

no test coverage detected