curved-angle-80449
11/04/2025, 7:46 PM# Current workaround:
conversation = Conversation(
agent=agent,
workspace=cwd,
visualize=False, # Confusing: we DO want visualization!
callbacks=[minimal_visualizer.on_event],
)
Seems like it would make more sense to be able to do this:
# Ideal (if API supported it):
conversation = Conversation(
agent=agent,
workspace=cwd,
visualize=minimal_visualizer, # Direct and clear!
)
and if you want the visualization off:
conversation = Conversation(
agent=agent,
workspace=cwd,
visualize=None
)
WDYT?chilly-france-44439
11/04/2025, 7:51 PMnutritious-balloon-65098
11/04/2025, 7:51 PMnutritious-balloon-65098
11/04/2025, 7:58 PMvisualize parameter now accepts three types for more intuitive usage:
1. True ā Use default visualizer (existing behavior, backward compatible)
2. False or None ā No visualization (existing behavior, backward compatible)
3. ConversationVisualizer instance ā Use custom visualizer (NEW)
š Before & After
Before (confusing):
conversation = Conversation(
agent=agent,
workspace=cwd,
visualize=False, # Confusing: we DO want visualization!
callbacks=[custom_visualizer.on_event],
)
After (clear and direct):
conversation = Conversation(
agent=agent,
workspace=cwd,
visualize=custom_visualizer, # Direct and clear!
)
š¦ Changes Made
1. Updated Type Signatures (3 files):
⦠conversation.py - Factory class with all overloads
⦠local_conversation.py - LocalConversation implementation
⦠remote_conversation.py - RemoteConversation implementation
2. Added Comprehensive Tests (1 file):
⦠3 new test cases for the new functionality
⦠All 65 tests pass ā
3. Created Example (1 file):
⦠examples/01_standalone_sdk/20_custom_visualizer.py
⦠Demonstrates custom visualizer with custom highlighting
ā
Quality Checks
⢠ā All pre-commit hooks pass (ruff format, ruff lint, pycodestyle, pyright)
⢠ā All 65 existing tests continue to pass (fully backward compatible)
⢠ā New functionality fully tested
⢠ā Changes are minimal and focused
⢠ā PR is in draft status as requested
The implementation is complete, tested, and ready for review! š
<sub>View full conversation</sub>chilly-france-44439
11/04/2025, 8:00 PMcurved-angle-80449
11/04/2025, 8:09 PM============================================================
:x: Found 1 undocumented example(s):
============================================================
- examples/01_standalone_sdk/20_custom_visualizer.py
:warning: Please add documentation for these examples in the docs repo.
============================================================
I'll update the PR with an example visualizer.chilly-france-44439
11/04/2025, 8:13 PMexamples/01_standalone_sdk/20_custom_visualizer.py script following this format (https://github.com/OpenHands/docs/blob/main/.github/scripts/README.md)
https://github.com/OpenHands/docs/tree/main/sdk/guides
@nutritious-balloon-65098 please update this script to print more detailed error message to instruct user about how to add the documentation https://github.com/OpenHands/software-agent-sdk/blob/main/.github/scripts/check_documented_examples.pynutritious-balloon-65098
11/04/2025, 8:13 PMnutritious-balloon-65098
11/04/2025, 8:17 PMsdk/guides/convo-custom-visualizer.mdx
⢠PR: https://github.com/OpenHands/docs/pull/77 (draft)
The documentation includes:
⢠Complete working example with proper code block format for auto-syncing
⢠Step-by-step guide for creating custom visualizers
⢠Before/after comparison showing the API improvement
⢠Customization options (highlight patterns, colors, styles, message filtering)
⢠Advanced usage examples
⢠Links to related guides
š ļø Improved Error Messages
Updated `.github/scripts/check_documented_examples.py`:
⢠Added detailed step-by-step instructions when undocumented examples are found
⢠Includes links to:
⦠Format documentation README
⦠Example documentation files
⦠Docs repository guide directory
⢠Makes it much clearer for contributors how to document their examples
š Cross-Referenced PRs
Both PRs now reference each other:
⢠Agent-SDK PR #1025: Updated description to include docs PR link
⢠Docs PR #77: Includes reference to agent-sdk PR #1025
⢠Docs PR notes it should be merged after agent-sdk PR is merged
š¦ Complete Changes Summary
Agent-SDK Repository (3 commits on feature/improve-visualizer-api):
1. Core API improvement with tests
2. Example demonstrating custom visualizer usage
3. Improved check script with better error messages
Docs Repository (1 commit on feature/improve-visualizer-api):
1. Comprehensive guide for custom visualizer feature
All changes are pushed and both PRs are ready for review! š
Links:
⢠Agent-SDK PR: https://github.com/OpenHands/software-agent-sdk/pull/1025
⢠Docs PR: https://github.com/OpenHands/docs/pull/77
<sub>View full conversation</sub>curved-angle-80449
11/05/2025, 11:53 AMchilly-france-44439
11/05/2025, 3:45 PMcurved-angle-80449
11/05/2025, 4:41 PMcurved-angle-80449
11/05/2025, 6:50 PMchilly-france-44439
11/05/2025, 8:20 PMcurved-angle-80449
11/05/2025, 8:25 PM