(output: PythonReplToolOutput)
| 249 | } |
| 250 | |
| 251 | function formatModelToolResult(output: PythonReplToolOutput): string { |
| 252 | const lines: string[] = [] |
| 253 | lines.push(output.error ? 'Python REPL execution failed.' : 'Python REPL execution completed.') |
| 254 | |
| 255 | if (output.toolCalls.length > 0) { |
| 256 | lines.push(`Inner tool calls (${output.toolCalls.length}):`) |
| 257 | for (const call of output.toolCalls) { |
| 258 | lines.push(`- ${formatToolCallSummary(call)}`) |
| 259 | } |
| 260 | } else { |
| 261 | lines.push('Inner tool calls: none') |
| 262 | } |
| 263 | |
| 264 | if (output.output.trim().length > 0) { |
| 265 | lines.push(`output:\n${preview(output.output)}`) |
| 266 | } |
| 267 | if (output.error) { |
| 268 | lines.push(`error:\n${output.error}`) |
| 269 | } |
| 270 | |
| 271 | return lines.join('\n\n') |
| 272 | } |
| 273 | |
| 274 | function renderProgressHint(data: ReplToolCallProgress): string { |
| 275 | if (data.phase !== 'start') { |
no test coverage detected