fix: log swallowed lazy-import failures to aid diagnosability#2899
fix: log swallowed lazy-import failures to aid diagnosability#2899praisonai-triage-agent[bot] wants to merge 1 commit into
Conversation
β¦2897) The package-level lazy loader silently converted real ImportError/ AttributeError into a cached None, masking genuine import bugs and stale mapping entries as confusing NoneType errors far from the root cause. This additive change preserves the graceful None fallback but logs the swallowed exception: DEBUG for a genuinely-absent optional module and WARNING for a missing attribute (which usually signals a stale mapping). Co-authored-by: MervinPraison <MervinPraison@users.noreply.github.com>
|
@coderabbitai review |
|
/review |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more β On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
β Action performedReview finished.
|
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: π Files selected for processing (1)
π WalkthroughWalkthroughThe lazy loader now initializes a module logger and distinguishes ChangesLazy loader diagnostics
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: π₯ Pre-merge checks | β 4 | β 1β Failed checks (1 warning)
β Passed checks (4 passed)
β¨ Finishing Touchesπ Generate docstrings
π§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR adds diagnostics for swallowed lazy-import failures. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix: log swallowed lazy-import failures ..." | Re-trigger Greptile |
|
@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Focus ONLY on Python packages (praisonaiagents, praisonai). Do NOT modify praisonai-rust or praisonai-ts. Read ALL comments above from Gemini, Qodo, CodeRabbit, and Copilot carefully before responding. Phase 1: Review per AGENTS.md
Phase 2: FIX Valid Issues Phase 3: Final Verdict |
|
Claude finished @MervinPraison's task ββ View job Final Architecture Review β PR #2899 β Approve
Scope: Single file Phase 1 β AGENTS.md checks
Phase 2 β Reviewer feedback
No valid bugs or architectural flaws raised. One minor note (non-blocking): the Validation (run locally)
Phase 3 β VerdictApprove. Purely additive, backward-compatible diagnostics that strengthen the SDK's debuggability with no hot-path cost. No changes needed β nothing pushed. |
Fixes #2897
Summary
The package-level lazy loader (
create_lazy_getattr_with_fallbackinpraisonaiagents/_lazy.py) swallowedImportError/AttributeErrorfor any mapped public symbol, returnedNone, and cached it for the process lifetime. This masked real import bugs and stale_LAZY_IMPORTSmapping entries as confusingTypeError: 'NoneType' object is not callableerrors far from the root cause.Change (purely additive)
Nonefallback and its caching β no behaviour/API change.ImportError(genuinely-absent optional module) β DEBUG (stays quiet by default).AttributeError(module imports but attribute missing β stale/renamed mapping) β WARNING (louder signal).Validation
None+ DEBUG log; stale attribute βNone+ WARNING log; valid symbol resolves; cachedNonepreserved.import praisonaiagentsstill works cleanly.Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Diagnostics