MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / truncateOutput

Function truncateOutput

packages/opencode-atomic-hooks/src/handlers/tool.ts:287–294  ·  view source on GitHub ↗
(output: string | undefined)

Source from the content-addressed store, hash-verified

285 * @returns Object with optional `tool_output` field
286 */
287export function truncateOutput(output: string | undefined): { tool_output?: string } {
288 if (!output) return {}
289
290 const trimmed = output.substring(0, MAX_TOOL_OUTPUT_LENGTH)
291 if (trimmed.length === 0) return {}
292
293 return { tool_output: trimmed }
294}

Callers 2

handlers.test.tsFile · 0.90
createAfterToolHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected