Skip to content

Comments

[pull] main from SwanHubX:main#145

Merged
pull[bot] merged 4 commits intoxj63:mainfrom
SwanHubX:main
Dec 5, 2025
Merged

[pull] main from SwanHubX:main#145
pull[bot] merged 4 commits intoxj63:mainfrom
SwanHubX:main

Conversation

@pull
Copy link

@pull pull bot commented Dec 5, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Talljack and others added 4 commits December 5, 2025 14:49
- Add TelegramBot class for Telegram Bot API communication
- Add TelegramCallback class with bilingual support (en/zh)
- Support notification on experiment start (optional) and stop
- Support success/error/offline mode notifications
- Add comprehensive unit tests (30 test cases)
- Add integration test script following notification_bark.py style
- Export TelegramCallback in plugin __init__.py
* fix(core): add default timeout for request session

为请求会话设置默认超时时间(60s),避免在请求未接收到响应的情况下阻塞上传的情况。

* optmize swanlab/core_python/session.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
#1359)

* fix(data): preserve more field in media metrics to fix image loading issue

- Modified __filter_list to accept keep_none_list parameter
- Ensure more field is always present in log data even when all values are None
- This fixes the frontend TypeError when accessing more[0]

Fixes #1354

* Apply suggestion from @gemini-code-assist[bot]

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Refactor __filter_list to simplify empty list handling

Updated the __filter_list static method to return None only when the input list is empty or all elements are None, unless keep_none_list is True. This refactoring simplifies the logic and improves code readability.

---------

Co-authored-by: Kang Li <79990647+SAKURA-CAT@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Kang Li <cunykang@gmail.com>
* Add LOG_LEVEL env var for log level configuration

Introduced SWANLAB_LOG_LEVEL environment variable to control SwanLab's log output level. The log level now prioritizes the environment variable over the log_level argument, improving configurability.

* Refactor metrics upload logic and add batch uploader

Moved metrics upload batching logic from upload.py to a new batch.py module, introducing improved chunking and client state management. Updated related imports and test cases to use the new batch uploader. Enhanced logging in client/__init__.py and improved type handling in toolkit/logger.py.

* Improve logger level handling and add tests

Refactored logger initialization to support environment variable for log level and improved handling of invalid log levels. Added unit tests to verify environment variable log level and defaulting to 'info' for invalid levels.

* Refactor batch uploader to simplify request handling

Removed the client_state_guard decorator and integrated client state checks directly into the trace_metrics function. This streamlines the request logic and eliminates unnecessary indirection, making the code easier to follow and maintain.

* Refactor SwanLog tests for better isolation and flexibility

Updated test_log.py to use instance-level logger management, allowing tests to operate on different SwanLog instances and improving test isolation. Modified start_proxy to accept a logger parameter and return both log file and logger. Minor improvements in batch.py to handle empty data in trace_metrics and expanded type hints.

* Remove LOG_LEVEL from environment in reset_some_env

Ensures that the LOG_LEVEL environment variable is deleted if present when resetting environment variables in reset_some_env.

* Improve log level handling and test cleanup

Log level is now consistently set to lowercase in SwanLog. Test setup now resets swanlog to ensure proper cleanup, handling potential RuntimeError. Removed LOG_LEVEL env var deletion from reset_some_env for better environment management.

* Refactor uploader URL usage and update tests

Centralized the '/house/metrics' URL as HOUSE_URL in upload.py and updated all references. Improved logging in client/__init__.py and batch.py. Fixed and clarified test for trace_metrics behavior when client is pending.

* Fix handling of None data in trace_metrics

Updated trace_metrics to handle cases where data is None by defaulting to an empty list, preventing errors when calculating total_len.
@pull pull bot locked and limited conversation to collaborators Dec 5, 2025
@pull pull bot added the ⤵️ pull label Dec 5, 2025
@pull pull bot merged commit 69ace65 into xj63:main Dec 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants