Skip to content

Conversation

@mozillazg
Copy link
Contributor

@mozillazg mozillazg commented Oct 20, 2025

Before

$ uv run cli.py test --task 'who are you' --filepath config.json 
...
NotADirectoryError: [Errno 20] Not a directory: 'config.json/agent-card.json'

After

$ uv run cli.py test --task 'who are you' --filepath ./
...
INFO:root:Starting KAgent
INFO:kagent.adk._a2a:
>>> User Query: who are you
...

Copilot AI review requested due to automatic review settings October 20, 2025 06:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fix the NotADirectoryError in the test CLI by decoupling the agent config file path from the agent card path.

  • Replace --filepath with explicit --agent-config and add --agent-card flags
  • Open the two files directly instead of joining agent-card.json to the config path

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@EItanya EItanya left a comment

Choose a reason for hiding this comment

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

Why this change? Why can't both files be in the same directory?

@mozillazg
Copy link
Contributor Author

@EItanya

Why this change? Why can't both files be in the same directory?

They can be in the same directory. The issue is that --filepath currently points to the config.json file. The code then joins agent-card.json to that file path, producing /path/to/config.json/agent-card.json, which raises a NotADirectoryError. If you prefer, I can change --filepath to accept the config directory instead, and read both files from there.

@EItanya
Copy link
Contributor

EItanya commented Oct 22, 2025

@EItanya

Why this change? Why can't both files be in the same directory?

They can be in the same directory. The issue is that --filepath currently points to the config.json file. The code then joins agent-card.json to that file path, producing /path/to/config.json/agent-card.json, which raises a NotADirectoryError. If you prefer, I can change --filepath to accept the config directory instead, and read both files from there.

Yes, let's do that

…irectory: 'xxx/agent-card.json'"

## Before

```
$ uv run cli.py test --task 'who are you' --filepath config.json
...
NotADirectoryError: [Errno 20] Not a directory: 'config.json/agent-card.json'
```

## After

```
$ uv run cli.py test --task 'who are you' --agent-config config.json --agent-card agent-card.json
...
INFO:root:Starting KAgent
INFO:kagent.adk._a2a:
>>> User Query: who are you
...
```

Signed-off-by: Huang Huang <[email protected]>
Signed-off-by: mozillazg <[email protected]>
Signed-off-by: mozillazg <[email protected]>
@mozillazg
Copy link
Contributor Author

@EItanya

Why this change? Why can't both files be in the same directory?

They can be in the same directory. The issue is that --filepath currently points to the config.json file. The code then joins agent-card.json to that file path, producing /path/to/config.json/agent-card.json, which raises a NotADirectoryError. If you prefer, I can change --filepath to accept the config directory instead, and read both files from there.

Yes, let's do that

@EItanya DONE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants