refactor: delegate _apply_tool_truncation_async to sync impl#2346
refactor: delegate _apply_tool_truncation_async to sync impl#2346praisonai-triage-agent[bot] wants to merge 2 commits into
Conversation
β¦2345) The async tool-truncation method was a byte-identical copy of the sync version with no await points. Make it a thin delegate to eliminate ~28 duplicated lines and remove sync/async drift risk. Co-authored-by: Mervin Praison <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.
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the βοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
π WalkthroughWalkthroughThe async tool-output truncation helper now delegates to the shared synchronous truncation implementation. The async-specific copy of truncation, token counting, and logging logic was removed. ChangesTool truncation delegation
Sequence Diagram(s)None Estimated code review effortπ― 1 (Trivial) | β±οΈ ~2 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
π₯ Pre-merge checks | β 5β Passed checks (5 passed)
β¨ Finishing Touchesπ§ͺ 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 |
|
@copilot Do a thorough review of this PR. Read ALL existing reviewer comments above from Qodo, Coderabbit, and Gemini first β incorporate their findings. Review areas:
|
Greptile SummaryThis PR centralizes tool-output truncation so the async path reuses the shared helper.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "fix: preserve [tool-truncation-async] lo..." | 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 #2346 β
Phase 1 β Review per AGENTS.md
This is a clean, valuable refactor that matches issue #2345 exactly. Phase 2 β Fixed valid issueGreptile P2 (VALID): Async truncation log misclassified. After delegation, the async path emitted the sync Fix (
This restores the diagnostic distinction without re-introducing the duplicated body β the refactor's core goal is preserved (net +3/-3, still a thin delegate). Skipped (not actionable): Qodo (reviews paused β no findings), CodeRabbit (π no actionable comments), Copilot/Gemini (no concrete blocking items surfaced beyond the log tag already handled). ValidationConfirmed: async path now logs Phase 3 β Verdict: β Approve (changes applied)All reviewer feedback resolved. The PR is a net-positive de-duplication with backward-compatible behavior and now correct diagnostics. Pushed
|
Addresses Greptile P2: async truncation was emitting the sync [tool-truncation] log tag after delegation. Add an optional log_tag param to the sync helper so the async wrapper can pass "tool-truncation-async", restoring the diagnostic distinction without re-introducing sync/async drift. Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
|
@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 #2346 β
Phase 1 β Review per AGENTS.md
Phase 2 β Valid issues already fixedGreptile P2 (VALID, resolved in commit
This restores the diagnostic distinction without re-introducing the duplicated body. Skipped (not actionable): Qodo (reviews paused β no findings), CodeRabbit (no actionable comments), Copilot/Gemini (no concrete blocking items beyond the log tag, already handled). Validation( Phase 3 β Verdict: β Approve (no further changes required)All reviewer feedback is resolved on the current HEAD (
|
Fixes #2345
Summary
_apply_tool_truncation_asyncinagent/chat_mixin.pywas a byte-identical copy of the sync_apply_tool_truncation(differing only in docstring and the-asynclog tag) and contained zeroawaitstatements. It is now a thin delegate to the sync implementation, eliminating ~28 duplicated lines and removing the sync/async drift risk.Changes
_apply_tool_truncation_asyncnow callsself._apply_tool_truncation(messages, compactor, policy).Capability preserved
(CompactionRoute.TRUNCATE_TOOLS, truncated_msgs)return.awaitthe method β unaffected.Validation
Generated with Claude Code
Summary by CodeRabbit