fix: handle json.Marshal error for truncated write bash input

This commit is contained in:
Joao
2026-01-29 13:07:20 +00:00
parent acdfa1c87f
commit 876b86ff91

View File

@@ -3173,7 +3173,11 @@ func (e *KiroExecutor) streamToChannel(ctx context.Context, body io.Reader, out
bashInput := map[string]interface{}{
"command": errorMsg,
}
inputJSON, _ := json.Marshal(bashInput)
inputJSON, err := json.Marshal(bashInput)
if err != nil {
log.Errorf("kiro: failed to marshal bash input for truncated write error: %v", err)
continue
}
inputDelta := kiroclaude.BuildClaudeInputJsonDeltaEvent(string(inputJSON), contentBlockIndex)
sseData = sdktranslator.TranslateStream(ctx, sdktranslator.FromString("kiro"), targetFormat, model, originalReq, claudeBody, inputDelta, &translatorParam)
for _, chunk := range sseData {