Skip to content

[Agents Extension] Default files list to "/"#8045

Open
trangevi wants to merge 2 commits intomainfrom
trangevi/files-list-default
Open

[Agents Extension] Default files list to "/"#8045
trangevi wants to merge 2 commits intomainfrom
trangevi/files-list-default

Conversation

@trangevi
Copy link
Copy Markdown
Member

@trangevi trangevi commented May 5, 2026

Provides default to aid in user experience.

Signed-off-by: trangevi <trangevi@microsoft.com>
Copilot AI review requested due to automatic review settings May 5, 2026 00:44
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

🔗 Linked Issue Required

Thanks for the contribution! Please link a GitHub issue to this PR by adding Fixes #123 to the description or using the sidebar.
No issue yet? Feel free to create one!

Copy link
Copy Markdown
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

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 list to 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 := "/"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Unfortunately at the moment the service doesn't seem to actually have a default root

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown
Member

@jongio jongio left a comment

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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>
@JeffreyCA JeffreyCA added the ext-agents azure.ai.agents extension label May 5, 2026
Copy link
Copy Markdown
Contributor

@wbreza wbreza left a comment

Choose a reason for hiding this comment

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

✅ 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.NewTLSServer validates the query parameter is sent correctly
  • Clean client_test_helpers.go utility follows good patterns (copyright header, adapter pattern, proper pipeline construction)

Remaining CI items (non-blocking for approval — CI-gated):

  • golangci-lint failure needs resolution before merge
  • PR governance check (missing linked issue)

Copy link
Copy Markdown
Member

@jongio jongio left a comment

Choose a reason for hiding this comment

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

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.

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

Labels

ext-agents azure.ai.agents extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants