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

Function responseBody

packages/llm/src/route/executor.ts:197–202  ·  view source on GitHub ↗
(body: string | void, request: HttpClientRequest.HttpClientRequest)

Source from the content-addressed store, hash-verified

195 )
196
197const responseBody = (body: string | void, request: HttpClientRequest.HttpClientRequest) => {
198 if (body === undefined) return {}
199 const redacted = redactBody(body, request)
200 if (redacted.length <= BODY_LIMIT) return { body: redacted }
201 return { body: redacted.slice(0, BODY_LIMIT), bodyTruncated: true }
202}
203
204const providerMessage = (status: number, body: { readonly body?: string }) => {
205 if (body.body && body.body.length <= 500) return `Provider request failed with HTTP ${status}: ${body.body}`

Callers 1

statusErrorFunction · 0.85

Calls 1

redactBodyFunction · 0.70

Tested by

no test coverage detected