Agent-Wiz icon indicating copy to clipboard operation
Agent-Wiz copied to clipboard

Add Handling for Incorrect Directory

Open Aaditya-G opened this issue 3 months ago • 3 comments

Currently if i pass down a command in the cli tool with incorrect directory , for example:

agent-wiz extract --framework your_framework --directory ./this/directory/does/not/exists --output sample.json

It generates a graph output containing start and end nodes:

{
    "nodes": [
        {
            "name": "Start",
            "function_name": null,
            "docstring": null,
            "node_type": "Start",
            "source_location": null,
            "metadata": {}
        },
        {
            "name": "End",
            "function_name": null,
            "docstring": null,
            "node_type": "End",
            "source_location": null,
            "metadata": {}
        }
    ],
    "edges": [],
    "metadata": {
        "framework": "your_sample_framework"
    }
}

This should not happen.

An ideal solution to this would be to notify in the CLI itself that the directory sent is not accessible, it either does not exists or we do not have permission to view contents.

Aaditya-G avatar Oct 05 '25 12:10 Aaditya-G

could you please assign it to me

IshantSingh24 avatar Oct 05 '25 13:10 IshantSingh24

could you please assign it to me

@IshantSingh24 can you please explain your approach for reaching the solution?

Aaditya-G avatar Oct 05 '25 13:10 Aaditya-G

@Aaditya-G i'll check once at the very start to see if the path exists and is the right type, just after extract command is run using os.path.isdir() if there is any other way you prefer?

IshantSingh24 avatar Oct 05 '25 15:10 IshantSingh24