Skip to content

Fix node name mismatch#171

Merged
lfnothias merged 1 commit into
devfrom
dev_madina
Apr 24, 2026
Merged

Fix node name mismatch#171
lfnothias merged 1 commit into
devfrom
dev_madina

Conversation

@madina1203
Copy link
Copy Markdown
Collaborator

@madina1203 madina1203 commented Apr 24, 2026

PR Type

Bug fix


Description

  • Corrected node name mismatches in function logic

  • Updated conditional checks for agent names


Diagram Walkthrough

flowchart LR
  oldNode1["Entry_agent"] -- "mismatch fix" --> newNode1["Entry_Agent"]
  oldNode2["Validator_agent"] -- "mismatch fix" --> newNode2["Validator"]
Loading

File Walkthrough

Relevant files
Bug fix
streamlit_utils.py
Corrected node name mismatches in utility function             

streamlit_webapp/streamlit_utils.py

  • Fixed node name mismatch for Entry_Agent
  • Fixed node name mismatch for Validator
  • Updated conditional logic for agent processing
+2/-2     


Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 24, 2026
    @coderabbitai
    Copy link
    Copy Markdown

    coderabbitai Bot commented Apr 24, 2026

    Important

    Review skipped

    Auto reviews are disabled on base/target branches other than the default branch.

    Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

    ⚙️ Run configuration

    Configuration used: Repository UI

    Review profile: CHILL

    Plan: Pro

    Run ID: 8098b613-1903-4f68-9e4f-0e14ad44713c

    You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

    Use the checkbox below for a quick retry:

    • 🔍 Trigger review
    ✨ Finishing Touches
    🧪 Generate unit tests (beta)
    • Create PR with unit tests
    • Commit unit tests in branch dev_madina

    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

    Comment @coderabbitai help to get the list of available commands and usage tips.

    @qodo-code-review
    Copy link
    Copy Markdown

    Review Summary by Qodo

    Fix node name mismatches in LangGraph output handler

    🐞 Bug fix

    Grey Divider

    Walkthroughs

    Description
    • Fix node name mismatches in LangGraph output processing
    • Update "Entry_agent" to "Entry_Agent" for consistency
    • Update "Validator_agent" to "Validator" for consistency
    
    Diagram
    flowchart LR
      A["Node Name Mismatch"] -- "Fix Entry_agent" --> B["Entry_Agent"]
      A -- "Fix Validator_agent" --> C["Validator"]
      B --> D["Corrected Output Processing"]
      C --> D
    
    Loading

    Grey Divider

    File Changes

    1. streamlit_webapp/streamlit_utils.py 🐞 Bug fix +2/-2

    Correct node name references in output handler

    • Changed node name "Entry_agent" to "Entry_Agent" on line 308
    • Changed node name "Validator_agent" to "Validator" on line 310
    • Ensures consistency between node definitions and output processing logic
    

    streamlit_webapp/streamlit_utils.py


    Grey Divider

    Qodo Logo


    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @qodo-code-review
    Copy link
    Copy Markdown

    qodo-code-review Bot commented Apr 24, 2026

    Code Review by Qodo

    🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

    Grey Divider


    Advisory comments

    1. Hardcoded node ID mapping 🐞 Bug ⚙ Maintainability
    Description
    new_process_langgraph_output hard-codes LangGraph node IDs (e.g., Entry_Agent, Validator) in
    conditional logic, duplicating the workflow configuration and making the UI silently stop rendering
    steps when node names change. This PR fixes one mismatch, but the same drift can recur whenever
    app/config/langgraph.json is updated without updating Streamlit rendering logic.
    
    Code

    streamlit_webapp/streamlit_utils.py[R308-313]

    +        elif k == "Entry_Agent":
                content = v['messages'][0].content
                contents.append({"type": "text", "content": f"Entry agent: {content}. \n\n"})
    -        elif k == "Validator_agent":
    +        elif k == "Validator":
                content = v['messages'][0].content
                contents.append({"type": "text", "content": f"Validator agent: {content}. \n\n"})
    Evidence
    The Streamlit renderer branches on literal node IDs (Entry_Agent, Validator, etc.), while the
    workflow’s source of truth for node IDs is app/config/langgraph.json which is loaded to build the
    graph. Because these identifiers are defined in two places, renames in the config can cause
    Streamlit to omit output for those nodes without any error.
    

    streamlit_webapp/streamlit_utils.py[295-323]
    app/config/langgraph.json[2-45]
    app/core/workflow/langraph_workflow.py[145-201]

    Agent prompt
    The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
    
    ## Issue description
    `streamlit_webapp/streamlit_utils.new_process_langgraph_output` uses hard-coded string comparisons for LangGraph node IDs. This duplicates the node-name source of truth in `app/config/langgraph.json` and makes Streamlit rendering fragile (node renames in config can break rendering silently).
    
    ## Issue Context
    The workflow is built dynamically from `app/config/langgraph.json` via `load_config()`, so Streamlit can also use that same config (or a shared constant) to drive rendering decisions.
    
    ## Fix Focus Areas
    - streamlit_webapp/streamlit_utils.py[295-337]
    - app/config/langgraph.json[2-45]
    - app/core/workflow/langraph_workflow.py[145-201]
    
    ## Implementation notes
    - Option A (preferred): Load `load_config()` in Streamlit and build a mapping from node_id -> display label/handler.
    - Option B: Add a small normalization layer (e.g., a dict of aliases) in one place so future renames don’t require touching branching logic.
    - Ensure unknown node IDs still produce a reasonable default rendering (e.g., show the last message content) instead of dropping output.
    

    ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


    Grey Divider

    Qodo Logo

    @github-actions
    Copy link
    Copy Markdown
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

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

    Missing DocString

    The function new_process_langgraph_output does not include a Google DocString. Adding a properly formatted docstring would improve code clarity and maintainability.

    def new_process_langgraph_output(k, v, session_id):
    
        contents = []
    
        if k != "__end__":
            if k == "supervisor":
                if 'next' in v and v['next'] == "Sparql_query_runner":
                    contents.append({"type": "text", "content": "The Agent Supervisor is Calling the Sparql Query Runner Agent to retrieve your information from ENPKG... \n\n"})
                elif 'next' in v and v['next'] != "FINISH":
                    agent_name = v['next']
                    contents.append({"type": "text", "content": f"Agent Supervisor is calling {agent_name}. \n\n"})
                elif 'next' in v and v['next'] == "FINISH":
                    contents.append({"type": "text", "content": "Chain finished"})
            elif k == "Entry_Agent":
                content = v['messages'][0].content
                contents.append({"type": "text", "content": f"Entry agent: {content}. \n\n"})
            elif k == "Validator":
                content = v['messages'][0].content
                contents.append({"type": "text", "content": f"Validator agent: {content}. \n\n"})
            elif k == "ENPKG_agent":
                content = v['messages'][0].content
                contents.append({"type": "text", "content": f"ENPKG: {content}. \n\n"})
            elif k == "Sparql_query_runner":

    @github-actions
    Copy link
    Copy Markdown
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Normalize entry node display

    Update the text displayed to match the updated node name. Changing the output label
    to Entry_Agent: will ensure consistency between the node identifier and its
    corresponding message.

    streamlit_webapp/streamlit_utils.py [308-310]

     elif k == "Entry_Agent":
         content = v['messages'][0].content
    -    contents.append({"type": "text", "content": f"Entry agent: {content}. \n\n"})
    +    contents.append({"type": "text", "content": f"Entry_Agent: {content}. \n\n"})
    Suggestion importance[1-10]: 5

    __

    Why: The suggestion updates the displayed text from "Entry agent:" to "Entry_Agent:" so that it matches the identifier, ensuring consistency. Although it is a minor text change, it improves clarity.

    Low
    Normalize validator node display

    Modify the output text to reflect the corrected node name. Changing Validator agent:
    to Validator: will ensure consistency with the updated condition.

    streamlit_webapp/streamlit_utils.py [311-313]

     elif k == "Validator":
         content = v['messages'][0].content
    -    contents.append({"type": "text", "content": f"Validator agent: {content}. \n\n"})
    +    contents.append({"type": "text", "content": f"Validator: {content}. \n\n"})
    Suggestion importance[1-10]: 5

    __

    Why: The suggestion changes the output text from "Validator agent:" to "Validator:" to align with the updated condition, providing clearer and consistent messaging.

    Low

    @lfnothias lfnothias merged commit 09b836c into dev Apr 24, 2026
    2 checks passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    bug_fix Review effort 2/5 size:XS This PR changes 0-9 lines, ignoring generated files.

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants