From e751e7271cc32ffc296f1bbd83db24e386400ebc Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Mon, 4 May 2026 16:34:44 -0400 Subject: [PATCH] fix(oc): replace hex dump of ByteString fields with size summary in gRPC logging Large ByteString values (e.g. image payloads) were being fully hex-encoded and logged, causing excessive memory allocation and log output that degraded image processing performance. Now logs just the byte count instead. Signed-off-by: Brandon McAnsh --- .../getcode/opencode/utils/logging/LoggingClientCallListener.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/opencode/src/main/kotlin/com/getcode/opencode/utils/logging/LoggingClientCallListener.kt b/services/opencode/src/main/kotlin/com/getcode/opencode/utils/logging/LoggingClientCallListener.kt index 0189e073a..7edb1afad 100644 --- a/services/opencode/src/main/kotlin/com/getcode/opencode/utils/logging/LoggingClientCallListener.kt +++ b/services/opencode/src/main/kotlin/com/getcode/opencode/utils/logging/LoggingClientCallListener.kt @@ -135,7 +135,7 @@ private fun formatFieldValue(fieldName: String, value: Any): String? = when (val if (value.serializedSize == 0) null else formatProto(value) } is ByteString -> { - if (value.isEmpty) null else value.toByteArray().toHex().masked() + if (value.isEmpty) null else "<${value.size()} bytes>" } is List<*> -> { if (value.isEmpty()) null