MCPcopy
hub / github.com/KeygraphHQ/shannon / truncateErrorMessage

Function truncateErrorMessage

apps/worker/src/temporal/activities.ts:85–90  ·  view source on GitHub ↗

* Truncate error message to prevent buffer overflow in Temporal serialization.

(message: string)

Source from the content-addressed store, hash-verified

83 * Truncate error message to prevent buffer overflow in Temporal serialization.
84 */
85function truncateErrorMessage(message: string): string {
86 if (message.length <= MAX_ERROR_MESSAGE_LENGTH) {
87 return message;
88 }
89 return `${message.slice(0, MAX_ERROR_MESSAGE_LENGTH - 20)}\n[truncated]`;
90}
91
92/**
93 * Truncate stack trace on an ApplicationFailure to prevent buffer overflow.

Callers 3

runAgentActivityFunction · 0.85
runPreflightValidationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected