fix: address Cubic P2 issues in CLI modules

This commit is contained in:
YeonGyu-Kim
2026-02-08 21:57:34 +09:00
parent ce37924fd8
commit babcb0050a
4 changed files with 39 additions and 8 deletions
+12 -2
View File
@@ -103,9 +103,19 @@ export function logEventVerbose(ctx: RunContext, payload: EventPayload): void {
const toolProps = props as ToolExecuteProps | undefined
const toolName = toolProps?.name ?? "unknown"
const input = toolProps?.input ?? {}
const inputStr = JSON.stringify(input).slice(0, 150)
let inputStr: string
try {
inputStr = JSON.stringify(input)
} catch {
try {
inputStr = String(input)
} catch {
inputStr = "[unserializable]"
}
}
const inputPreview = inputStr.slice(0, 150)
console.error(pc.cyan(`${sessionTag} TOOL.EXECUTE: ${pc.bold(toolName)}`))
console.error(pc.dim(` input: ${inputStr}${inputStr.length >= 150 ? "..." : ""}`))
console.error(pc.dim(` input: ${inputPreview}${inputStr.length >= 150 ? "..." : ""}`))
break
}