Conversation
Signed-off-by: trangevi <trangevi@microsoft.com>
🔗 Linked Issue RequiredThanks for the contribution! Please link a GitHub issue to this PR by adding |
There was a problem hiding this comment.
Pull request overview
This PR updates the azure.ai.agents files list command so an omitted remote path defaults to the session root, aiming to improve CLI usability for file browsing.
Changes:
- Changed
files listto initialize its default remote path as"/"instead of"". - Added a test asserting the command help still describes the default behavior as listing the root directory.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cli/azd/extensions/azure.ai.agents/internal/cmd/files.go |
Changes the default path passed by files list when no positional path is provided. |
cli/azd/extensions/azure.ai.agents/internal/cmd/files_test.go |
Adds a command-construction test for the documented default root-directory behavior. |
| } | ||
|
|
||
| remotePath := "" | ||
| remotePath := "/" |
There was a problem hiding this comment.
Unfortunately at the moment the service doesn't seem to actually have a default root
There was a problem hiding this comment.
Recent messaging is that the service may be adding a default, leaving this open until I get more details
| func TestFilesListCommand_DefaultPathIsRoot(t *testing.T) { | ||
| cmd := newFilesListCommand() | ||
|
|
||
| // The Use line should show [remote-path] as optional with "/" as default behavior. |
jongio
left a comment
There was a problem hiding this comment.
The code change is correct - sending / explicitly makes sense if the service doesn't default to root when the path parameter is omitted. The author confirmed this in the thread.
One gap: the new test only asserts help text strings (cmd.Use and cmd.Long), which would pass identically whether the default is "" or "/". It doesn't exercise the changed behavior. Consider a test that invokes the command's RunE (or at least inspects the constructed FilesListAction) to verify remotePath is "/" when no arg is provided.
| func TestFilesListCommand_DefaultPathIsRoot(t *testing.T) { | ||
| cmd := newFilesListCommand() | ||
|
|
||
| // The Use line should show [remote-path] as optional with "/" as default behavior. |
There was a problem hiding this comment.
This test checks static help text, not the runtime behavior. It passes regardless of what remotePath gets set to in the RunE closure.
A more useful test would invoke the command (with a stubbed client) and verify that ListSessionFiles receives "/" when no args are given - that way a regression from "/" back to "" would actually fail.
Signed-off-by: trangevi <trangevi@microsoft.com>
wbreza
left a comment
There was a problem hiding this comment.
✅ Approved (Re-Review)
Original P0 concern (API behavior change from "``` to "/"``) is resolved — author confirmed the backend service requires an explicit "/" and has no default root.
Test coverage is meaningfully improved with the new commit:
- Table-driven unit test covers default and explicit path cases
- Integration test with
httptest.NewTLSServervalidates the query parameter is sent correctly - Clean
client_test_helpers.goutility follows good patterns (copyright header, adapter pattern, proper pipeline construction)
Remaining CI items (non-blocking for approval — CI-gated):
golangci-lintfailure needs resolution before merge- PR governance check (missing linked issue)
jongio
left a comment
There was a problem hiding this comment.
Incremental review: the new commit fully addresses my earlier test coverage feedback. The table-driven unit test plus the integration test with httptest give solid confidence that ListSessionFiles receives ?path=/ when no explicit path argument is provided. Clean test helper pattern for cross-package testing too. Looks good.
Provides default to aid in user experience.