Skip to content

Fix UnboundLocalError in retrieve.py due to missing instance_id assignment #64

Open
@MichaelYang-lyx

Description

@MichaelYang-lyx

There is an issue in /mnt/llm_test/code/yyb/projects/Agentless/Agentless/agentless/fl/retrieve.py where reusing previous retrieval results leads to the following error:

UnboundLocalError: cannot access local variable 'logger' where it is not associated with a value

Issue Details

  • The error occurs because the instance_id is not properly assigned before constructing the log file path.
  • This can be resolved by adding the following lines at line 28 in retrieve.py:
instance_id = bug["instance_id"]
log_file = os.path.join(
    args.output_folder, "retrieval_logs", f"{instance_id}.log"
)

Steps to Reproduce:

  1. Run the script with previously retrieved results.
  2. Observe the UnboundLocalError.

Expected Behavior:

  • The script should correctly log retrieval operations without raising an UnboundLocalError.

Suggested Fix:

  • Assign instance_id and construct the log_file before logging operations.

Let me know if you want any modifications! 🚀

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions