PtcRunner.SubAgent.Debug (PtcRunner v0.5.1)

View Source

Debug helpers for visualizing SubAgent execution.

Provides functions to pretty-print execution traces and agent chains, making it easier to understand what happened during agent execution.

Raw Mode

Use print_trace(step, raw: true) to see the complete LLM interaction:

  • Raw Input: Messages sent to the LLM (excluding system prompt)
  • Raw Response: Full LLM output including reasoning
  • Lines shown exactly as-is (no wrapping or truncation)

For all messages including the system prompt, use messages: true instead. Note: messages: true wraps long lines to 160 chars.

View Modes

ViewDescription
:turns (default)Show programs + results from Turn structs
:compressedShow what the LLM sees (compressed format)

Examples

# Default compact view
{:ok, step} = SubAgent.run(agent, llm: llm)
SubAgent.Debug.print_trace(step)

# Include raw input and raw response
SubAgent.Debug.print_trace(step, raw: true)

# Show all messages including system prompt
SubAgent.Debug.print_trace(step, messages: true)

# Show compressed view (what LLM sees)
SubAgent.Debug.print_trace(step, view: :compressed)

# Print agent chain
SubAgent.Debug.print_chain([step1, step2, step3])

Summary

Functions

Pretty-print a chain of SubAgent executions.

Pretty-print a SubAgent execution trace.

Functions