fix: remove duplicate attempt field in OnRetryInput dataclass#2898
fix: remove duplicate attempt field in OnRetryInput dataclass#2898praisonai-triage-agent[bot] wants to merge 1 commit into
Conversation
β¦2896) The OnRetryInput hook dataclass declared the `attempt` field twice with conflicting defaults (1 then 0), so the intended 1-based default was silently shadowed by 0. The to_dict() also wrote the "attempt" key twice. Removed the shadowing declaration and the duplicate dict key, keeping a single `attempt` field with the intended 1-based default. All production constructors pass attempt= explicitly, so runtime behaviour is unchanged. 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)
π WalkthroughWalkthrough
ChangesRetry input contract
Estimated code review effort: 2 (Simple) | ~10 minutes π₯ Pre-merge checks | β 5β Passed checks (5 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 cleans up the retry hook input shape. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix: remove duplicate attempt field in O..." | 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 #2898 β Approved
Phase 1 β Architecture Review
Phase 2 β Reviewer Feedback
No valid bugs or architectural flaws raised by any reviewer. No additional fixes needed. Verification (runtime)
Phase 3 β Final Verdictβ
Approved. Minimal, focused, backward-compatible correctness fix. No files modified by me β the committed change is already complete and correct. Safe to merge. |
Fixes #2896
Summary
The
OnRetryInputhook dataclass inpraisonaiagents/hooks/events.pydeclared theattemptfield twice with conflicting defaults (1then0). Python keeps only the last annotation, so the intended 1-based default was silently shadowed by0. Theto_dict()method also wrote the"attempt"key twice (a no-op).Changes
attempt: int = 0declaration, keeping a singleattempt: int = 1field with the intended 1-based default and a clarifying comment."attempt"key into_dict().Capability preserved
agent/tool_execution.py,agent/execution_mixin.py,agent/chat_mixin.py:4254and:4335) passattempt=explicitly, so runtime behaviour is unchanged.to_dict()output is identical (the duplicate key produced a single entry).Validation
1andto_dict()["attempt"]returns1.tests/unit/hooks/β 65 passed.tests/unit/tools/test_retry.py+tests/unit/test_tool_retry_integration.pyβ 38 passed.Generated with Claude Code
Summary by CodeRabbit