fix: address Cubic P2 issues in CLI modules
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user