Write Claude's text output to the trace, truncated.
(out: Any, text: str)
| 648 | |
| 649 | |
| 650 | def _write_text_block(out: Any, text: str) -> None: |
| 651 | """Write Claude's text output to the trace, truncated.""" |
| 652 | lines = text.strip().split("\n") |
| 653 | if len(lines) <= 3: |
| 654 | for line in lines: |
| 655 | out.write(f" {_DIM}{line}{_RESET}\n") |
| 656 | else: |
| 657 | out.write(f" {_DIM}{lines[0]}{_RESET}\n") |
| 658 | out.write(f" {_DIM} ...({len(lines) - 2} more lines){_RESET}\n") |
| 659 | out.write(f" {_DIM}{lines[-1]}{_RESET}\n") |
| 660 | out.flush() |
| 661 | |
| 662 | |
| 663 | def create_claude_code_agent_fn( |
no test coverage detected