Skip to content

fix: improve logger, error handling, and documentation#815

Open
CodyRobot wants to merge 1 commit intoQwenLM:mainfrom
CodyRobot:fix/logger-and-error-handling-improvements
Open

fix: improve logger, error handling, and documentation#815
CodyRobot wants to merge 1 commit intoQwenLM:mainfrom
CodyRobot:fix/logger-and-error-handling-improvements

Conversation

@CodyRobot
Copy link
Copy Markdown

Summary

This PR improves code robustness, maintainability, and developer experience with the following changes:

Changes

  • Fix duplicate logger handler issue (qwen_agent/log.py): Added check for existing handlers to prevent duplicate log output
  • Improve error message matching (qwen_agent/llm/base.py): Changed to case-insensitive matching and enhanced context length error detection
  • Add comprehensive docstrings (qwen_agent/utils/utils.py, qwen_agent/llm/base.py): Added complete documentation for json_loads, extract_text_from_message, retry_model_service, and retry_model_service_iterator functions
  • Improve API usability (qwen_agent/utils/utils.py): Added default parameter value to extract_text_from_message

Testing

  • Code changes are backward compatible
  • No breaking changes to existing APIs
  • Improved type hints for better IDE support

- Fix duplicate logger handler issue by checking existing handlers
- Improve error message matching in retry logic (case-insensitive)
- Add comprehensive docstrings to utility functions
- Add default parameter value to extract_text_from_message
- Enhance type hints and documentation for better IDE support

These changes improve code robustness, maintainability, and developer experience.
@CodyRobot CodyRobot force-pushed the fix/logger-and-error-handling-improvements branch from f91f01b to 1f07948 Compare March 8, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant