MCPcopy
hub / github.com/opentrace/opentrace / _write_text_block

Function _write_text_block

agent/src/opentrace_agent/benchmarks/agent.py:650–660  ·  view source on GitHub ↗

Write Claude's text output to the trace, truncated.

(out: Any, text: str)

Source from the content-addressed store, hash-verified

648
649
650def _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
663def create_claude_code_agent_fn(

Callers 1

_run_claude_code_tracedFunction · 0.85

Calls 2

writeMethod · 0.80
flushMethod · 0.65

Tested by

no test coverage detected