You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: The timed_with_status method was swallowing exceptions, making debugging difficult #1679
Summary: Fixed the bug in timed_with_status decorator where exceptions were being swallowed when no fallback was provided.
Root Cause: The decorator's except block caught exceptions but only returned a fallback result when a fallback function was provided. When no fallback existed, the exception was silently suppressed, causing the decorated function to return None instead of propagating the error.
Fix: Added an explicit else: raise clause after the fallback check to re-raise the exception when no fallback is provided. This preserves the decorator's timing and logging functionality while ensuring exceptions propagate correctly for debugging.
Changes:
src/memos/utils.py: Added else clause to re-raise exceptions (lines 182-184)
tests/test_utils_timing.py: Added two test cases to verify exceptions propagate correctly without fallback and with explicit fallback=None
Testing: Created and ran a standalone verification script that confirmed:
Exceptions now propagate correctly when no fallback is provided
Fallback mechanism still works when a fallback function is provided
Normal execution (success case) continues to work as expected
This fix resolves the debugging difficulty reported in issue #1679 where incorrect API keys or URLs would fail silently instead of raising clear exceptions.
Activity
16 remaining items
Memtensor-AI commentedon Jun 4, 2026
🤖 AutoDev has picked up this issue and started working on it.
Task ID:
8513e5d0d07f0f2dWorking branch:
bugfix/autodev-1679Target branch:
dev-20260604-v2.0.19Workflow: opsp (analysis → coding → testing → PR)
I will post the PR link here once done. If I need more information, I will ask in the comments.
fix: re-raise exceptions in timed_with_status when no fallback provided
Memtensor-AI commentedon Jun 4, 2026
✅ AutoDev task
8513e5d0d07f0f2dcompleted.Summary: Fixed the bug in timed_with_status decorator where exceptions were being swallowed when no fallback was provided.
Root Cause: The decorator's except block caught exceptions but only returned a fallback result when a fallback function was provided. When no fallback existed, the exception was silently suppressed, causing the decorated function to return None instead of propagating the error.
Fix: Added an explicit
else: raiseclause after the fallback check to re-raise the exception when no fallback is provided. This preserves the decorator's timing and logging functionality while ensuring exceptions propagate correctly for debugging.Changes:
Testing: Created and ran a standalone verification script that confirmed:
This fix resolves the debugging difficulty reported in issue #1679 where incorrect API keys or URLs would fail silently instead of raising clear exceptions.
Base branch:
dev-20260604-v2.0.19Branch:
bugfix/autodev-1679Commit:
c251f02PR: #1883
Assigned to: @MatthewZhuang, @CarltonXiang, @syzsunshine219
Reviewers: @MatthewZhuang, @CarltonXiang, @syzsunshine219
CarltonXiang commentedon Jul 7, 2026
Fixed by merged PR #1885 and released to main via #2058.