Skip to content

Revert "fix: prevent duplicate Task and Response display when using litellm with memory"#614

Merged
MervinPraison merged 1 commit into
mainfrom
revert-613-claude/issue-612-20250605_213542
Jun 6, 2025
Merged

Revert "fix: prevent duplicate Task and Response display when using litellm with memory"#614
MervinPraison merged 1 commit into
mainfrom
revert-613-claude/issue-612-20250605_213542

Conversation

@MervinPraison

@MervinPraison MervinPraison commented Jun 6, 2025

Copy link
Copy Markdown
Owner

User description

Reverts #613


PR Type

Bug fix


Description

  • Reverts previous fix that suppressed duplicate Task/Response display

  • Removes display_interaction argument from agent and LLM calls

  • Restores original verbose display behavior in LLM responses

  • Ensures interaction display logic matches pre-fix implementation


Changes walkthrough 📝

Relevant files
Bug fix
agent.py
Remove display_interaction argument from agent LLM calls 

src/praisonai-agents/praisonaiagents/agent/agent.py

  • Removed display_interaction=False from LLM call arguments
  • Restored original function signatures for chat and async chat methods
  • Reverted logic to previous verbose display behavior
  • +4/-8     
    llm.py
    Revert display_interaction logic in LLM response methods 

    src/praisonai-agents/praisonaiagents/llm/llm.py

  • Removed display_interaction parameter from get_response and related
    methods
  • Restored verbose display logic to not depend on display_interaction
  • Reverted all conditional checks to use only verbose for display
  • Ensured all response display logic matches pre-fix implementation
  • +10/-11 

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Summary by CodeRabbit

    • Refactor
      • Streamlined verbose output logic for AI responses by removing the dependency on the display_interaction setting. Verbose outputs now rely solely on the verbose flag, simplifying user experience. No changes to core functionality or visible features.

    @coderabbitai

    coderabbitai Bot commented Jun 6, 2025

    Copy link
    Copy Markdown
    Contributor

    Caution

    Review failed

    The pull request is closed.

    Walkthrough

    The changes remove the display_interaction parameter from the get_response and get_response_async methods in the LLM module and all related calls in the Agent class. All display logic now relies solely on the verbose flag, simplifying conditions and function signatures without altering the control flow or error handling.

    Changes

    File(s) Change Summary
    .../agent/agent.py Removed display_interaction argument from all calls to get_response and get_response_async.
    .../llm/llm.py Removed display_interaction parameter from method signatures and all related conditionals.

    Poem

    🐇
    A flag has hopped out of the code,
    No more display_interaction to load.
    Now verbose stands all alone,
    Deciding what should be shown.
    Simpler checks and cleaner flow—
    That’s how the garden of code should grow!
    🌱

    Suggested labels

    codex


    📜 Recent review details

    Configuration used: CodeRabbit UI
    Review profile: CHILL
    Plan: Pro

    📥 Commits

    Reviewing files that changed from the base of the PR and between afa747f and 31c054a.

    📒 Files selected for processing (2)
    • src/praisonai-agents/praisonaiagents/agent/agent.py (4 hunks)
    • src/praisonai-agents/praisonaiagents/llm/llm.py (7 hunks)
    ✨ Finishing Touches
    • 📝 Generate Docstrings

    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.

    ❤️ Share
    🪧 Tips

    Chat

    There are 3 ways to chat with CodeRabbit:

    • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
      • I pushed a fix in commit <commit_id>, please review it.
      • Explain this complex logic.
      • Open a follow-up GitHub issue for this discussion.
    • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
      • @coderabbitai explain this code block.
      • @coderabbitai modularize this function.
    • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
      • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
      • @coderabbitai read src/utils.ts and explain its main purpose.
      • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
      • @coderabbitai help me debug CodeRabbit configuration file.

    Support

    Need help? Create a ticket on our support page for assistance with any issues or questions.

    Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

    CodeRabbit Commands (Invoked using PR comments)

    • @coderabbitai pause to pause the reviews on a PR.
    • @coderabbitai resume to resume the paused reviews.
    • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
    • @coderabbitai full review to do a full review from scratch and review all the files again.
    • @coderabbitai summary to regenerate the summary of the PR.
    • @coderabbitai generate docstrings to generate docstrings for this PR.
    • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
    • @coderabbitai resolve resolve all the CodeRabbit review comments.
    • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
    • @coderabbitai help to get help.

    Other keywords and placeholders

    • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
    • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
    • Add @coderabbitai anywhere in the PR title to generate the title automatically.

    CodeRabbit Configuration File (.coderabbit.yaml)

    • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
    • Please see the configuration documentation for more information.
    • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

    Documentation and Community

    • Visit our Documentation for detailed information on how to use CodeRabbit.
    • Join our Discord Community to get help, request features, and share feedback.
    • Follow us on X/Twitter for updates and announcements.

    @MervinPraison MervinPraison merged commit 3720cb7 into main Jun 6, 2025
    6 of 9 checks passed
    @qodo-code-review

    Copy link
    Copy Markdown

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Duplicate Output

    This revert will restore the original behavior where interactions are displayed twice when using litellm with memory. The PR removes the display_interaction parameter that was added to prevent duplicate Task and Response displays.

    if verbose and reasoning_content:
        display_interaction(
            original_prompt,
            f"Reasoning:\n{reasoning_content}\n\nAnswer:\n{response_text}",
            markdown=markdown,
            generation_time=time.time() - current_time,
            console=console
        )
    else:
        display_interaction(
            original_prompt,
            response_text,
            markdown=markdown,

    @qodo-code-review

    Copy link
    Copy Markdown

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @gemini-code-assist gemini-code-assist Bot left a comment

    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Hello @MervinPraison, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

    Summary of Changes

    Hello! Gemini here, providing a summary of this pull request. This PR is a direct revert of a previous change (PR #613) which aimed to prevent duplicate Task and Response displays specifically when using litellm with memory. The previous fix introduced a display_interaction parameter and logic to control output display. This revert removes that parameter and the associated logic from the LLM methods and the calls to them in the agent code, effectively undoing the implementation of the fix from #613. The reason for the revert isn't detailed in the description, but it suggests the previous approach might not have been the correct or complete solution.

    Highlights

    • Revert Previous Fix: This PR reverts the changes introduced in PR #613, which attempted to prevent duplicate display issues when using litellm with memory.
    • Removed Display Control Parameter: The display_interaction parameter has been removed from the LLM's get_response and get_response_async methods.
    • Simplified Display Logic: The logic controlling when interactions are displayed now relies solely on the verbose flag, removing the check for the display_interaction parameter.

    Changelog

    • src/praisonai-agents/praisonaiagents/agent/agent.py
      • Removed the display_interaction=False argument from calls to the LLM's response methods (_chat_completion, chat, achat).
    • src/praisonai-agents/praisonaiagents/llm/llm.py
      • Removed the display_interaction parameter from the get_response and get_response_async function signatures.
      • Removed the and display_interaction condition from several if verbose and display_interaction: checks, simplifying the display logic.
    Using Gemini Code Assist

    The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

    Invoking Gemini

    You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

    Feature Command Description
    Code Review /gemini review Performs a code review for the current pull request in its current state.
    Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
    Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
    Help /gemini help Displays a list of available commands.

    Customization

    To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

    Limitations & Feedback

    Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

    You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

    Footnotes

    1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

    @gemini-code-assist gemini-code-assist Bot left a comment

    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Code Review

    This pull request successfully reverts the changes introduced in PR #613, which aimed to prevent duplicate Task and Response displays when using LiteLLM with memory. The changes correctly remove the display_interaction parameter and associated logic from the LLM class and the calls to the LLM from the Agent class. This aligns with the stated goal of restoring the previous verbose display behavior.

    Summary of Findings

    • Re-introduction of Duplicate Display Issue: This revert PR removes the logic that prevented duplicate Task/Response displays when using LiteLLM with memory. This action re-introduces the original issue that PR #613 aimed to fix. While this is the intended outcome of a revert, it's important to acknowledge that the duplicate display behavior will return.

    Merge Readiness

    The code changes correctly implement the revert of PR #613. The primary consequence is the re-introduction of the duplicate Task/Response display issue when using LiteLLM with memory, which is noted as a medium severity finding. Whether this PR is ready to merge depends on whether re-introducing this specific behavior is acceptable for the project at this time. Please confirm if the re-introduced duplicate display is an acceptable trade-off for reverting the previous fix. I am unable to approve this pull request; please have other reviewers assess and approve the changes before merging.

    @cursor cursor Bot left a comment

    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Bug: Interaction Display Logic Error

    The conditional logic for displaying interactions in the get_response method was incorrectly changed from elif verbose and display_interaction: to else:. This causes display_interaction to be called even when verbose=False, violating the intended behavior of only displaying output when verbose mode is enabled. The condition should be elif verbose: to maintain the correct check.

    src/praisonai-agents/praisonaiagents/llm/llm.py#L456-L472

    # Optionally display reasoning if present
    if verbose and reasoning_content:
    display_interaction(
    original_prompt,
    f"Reasoning:\n{reasoning_content}\n\nAnswer:\n{response_text}",
    markdown=markdown,
    generation_time=time.time() - current_time,
    console=console
    )
    else:
    display_interaction(
    original_prompt,
    response_text,
    markdown=markdown,
    generation_time=time.time() - current_time,
    console=console
    )

    Fix in Cursor


    BugBot free trial expires on June 11, 2025
    You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.

    Was this report helpful? Give feedback by reacting with 👍 or 👎

    shaneholloman pushed a commit to shaneholloman/praisonai that referenced this pull request Feb 4, 2026
    …aude/issue-612-20250605_213542
    
    Revert "fix: prevent duplicate Task and Response display when using litellm with memory"
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    1 participant