Skip to content

[Agent Extension] Add file operations for hosted agent sessions#7141

Merged
trangevi merged 11 commits intomainfrom
trangevi/agent-files-handling
Mar 18, 2026
Merged

[Agent Extension] Add file operations for hosted agent sessions#7141
trangevi merged 11 commits intomainfrom
trangevi/agent-files-handling

Conversation

@trangevi
Copy link
Copy Markdown
Member

@trangevi trangevi commented Mar 13, 2026

Add 'azd ai agent files' command group with upload, download, list, and remove subcommands for managing session-scoped files on hosted agent sandboxes. This enables debugging, seeding data, and agent setup.

New commands:

  • files upload --path
  • files download [-o ]
  • files list [remote-path] [--output json|table]
  • files remove [--recursive]

All commands require --name, --version, and --session flags. Uses the vnext API version (2025-11-15-preview) for session-scoped endpoints.

fixes #7132

Add 'azd ai agent files' command group with upload, download, list, and
remove subcommands for managing session-scoped files on hosted agent
sandboxes. This enables debugging, seeding data, and agent setup.

New commands:
- files upload <remote-path> --path <local-path>
- files download <remote-path> [-o <output-path>]
- files list [remote-path] [--output json|table]
- files remove <remote-path> [--recursive]

All commands require --name, --version, and --session flags. Uses the
vnext API version (2025-11-15-preview) for session-scoped endpoints.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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

Adds a new azd ai agent files command group to the azure.ai.agents extension to manage session-scoped files on hosted agent sandboxes, backed by new session file API operations and models.

Changes:

  • Introduces files command group with upload, download, list, and remove subcommands (plus basic command/formatting tests).
  • Adds session file API operations (upload/download/list/remove) to the agent API client.
  • Adds session file listing models and new extension error codes for file-related failures.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_api/operations.go Adds client operations for session file upload/download/list/remove.
cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_api/models.go Adds models for representing session file listings.
cli/azd/extensions/azure.ai.agents/internal/exterrors/codes.go Introduces new error codes for file operation scenarios.
cli/azd/extensions/azure.ai.agents/internal/cmd/root.go Registers the new files command group on the extension root command.
cli/azd/extensions/azure.ai.agents/internal/cmd/files.go Implements the files command group and subcommands (CLI UX + printing).
cli/azd/extensions/azure.ai.agents/internal/cmd/files_test.go Adds tests for subcommand presence, required flags, and output helpers.

You can also share your feedback on Copilot code review. Take the survey.

trangevi and others added 7 commits March 16, 2026 10:24
Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
@trangevi trangevi marked this pull request as ready for review March 17, 2026 21:56
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
@trangevi trangevi merged commit cd60220 into main Mar 18, 2026
17 checks passed
Copilot AI added a commit that referenced this pull request Mar 18, 2026
…7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
rajeshkamal5050 added a commit that referenced this pull request Mar 18, 2026
* Initial plan

* Prepare azure.ai.agents 0.1.16-preview patch release (#7141, #7175, #7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Remove registry.json changes - to be updated after builds are generated

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Add Breaking Changes section in CHANGELOG.md and move #7181 under it

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
github-actions bot added a commit to weikanglim/azure-dev that referenced this pull request Mar 18, 2026
- Add 1.24.0-beta.1 unreleased section to cli/azd/CHANGELOG.md
  with entries for configurable deploy timeout (Azure#7045), git dirty
  check and workflow consent for azd init agent mode (Azure#7162),
  cobra command tree fix (Azure#7171), and input validation improvements (Azure#7175)
- Bump cli/version.txt to 1.24.0-beta.1
- Add 0.1.16-preview section to agents CHANGELOG with entries
  for file operations (Azure#7141), input validation (Azure#7175), and
  breaking change for show/monitor commands (Azure#7181)
- Bump agents version.txt and extension.yaml to 0.1.16-preview

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
wbreza pushed a commit to wbreza/azure-dev that referenced this pull request Mar 18, 2026
* Initial plan

* Prepare azure.ai.agents 0.1.16-preview patch release (Azure#7141, Azure#7175, Azure#7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Remove registry.json changes - to be updated after builds are generated

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Add Breaking Changes section in CHANGELOG.md and move Azure#7181 under it

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
wbreza pushed a commit to wbreza/azure-dev that referenced this pull request Mar 18, 2026
* Initial plan

* Prepare azure.ai.agents 0.1.16-preview patch release (Azure#7141, Azure#7175, Azure#7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Remove registry.json changes - to be updated after builds are generated

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Add Breaking Changes section in CHANGELOG.md and move Azure#7181 under it

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
jongio pushed a commit to jongio/azure-dev that referenced this pull request Mar 27, 2026
…e#7141)

* Add file operations for hosted agent sessions (Azure#7132)

Add 'azd ai agent files' command group with upload, download, list, and
remove subcommands for managing session-scoped files on hosted agent
sandboxes. This enables debugging, seeding data, and agent setup.

New commands:
- files upload <remote-path> --path <local-path>
- files download <remote-path> [-o <output-path>]
- files list [remote-path] [--output json|table]
- files remove <remote-path> [--recursive]

All commands require --name, --version, and --session flags. Uses the
vnext API version (2025-11-15-preview) for session-scoped endpoints.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Copilot suggestion

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Modify files commands to not take name and version

Signed-off-by: trangevi <trangevi@microsoft.com>

* List fixes. Header fixes

Signed-off-by: trangevi <trangevi@microsoft.com>

* Add mkdir command. clean up parameters

Signed-off-by: trangevi <trangevi@microsoft.com>

* Linter

Signed-off-by: trangevi <trangevi@microsoft.com>

* Add stat command

Signed-off-by: trangevi <trangevi@microsoft.com>

* PR comment

Signed-off-by: trangevi <trangevi@microsoft.com>

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jongio pushed a commit to jongio/azure-dev that referenced this pull request Mar 27, 2026
* Initial plan

* Prepare azure.ai.agents 0.1.16-preview patch release (Azure#7141, Azure#7175, Azure#7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Remove registry.json changes - to be updated after builds are generated

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Add Breaking Changes section in CHANGELOG.md and move Azure#7181 under it

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
jongio pushed a commit to jongio/azure-dev that referenced this pull request Mar 27, 2026
…e#7141)

* Add file operations for hosted agent sessions (Azure#7132)

Add 'azd ai agent files' command group with upload, download, list, and
remove subcommands for managing session-scoped files on hosted agent
sandboxes. This enables debugging, seeding data, and agent setup.

New commands:
- files upload <remote-path> --path <local-path>
- files download <remote-path> [-o <output-path>]
- files list [remote-path] [--output json|table]
- files remove <remote-path> [--recursive]

All commands require --name, --version, and --session flags. Uses the
vnext API version (2025-11-15-preview) for session-scoped endpoints.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Copilot suggestion

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Modify files commands to not take name and version

Signed-off-by: trangevi <trangevi@microsoft.com>

* List fixes. Header fixes

Signed-off-by: trangevi <trangevi@microsoft.com>

* Add mkdir command. clean up parameters

Signed-off-by: trangevi <trangevi@microsoft.com>

* Linter

Signed-off-by: trangevi <trangevi@microsoft.com>

* Add stat command

Signed-off-by: trangevi <trangevi@microsoft.com>

* PR comment

Signed-off-by: trangevi <trangevi@microsoft.com>

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jongio pushed a commit to jongio/azure-dev that referenced this pull request Mar 27, 2026
* Initial plan

* Prepare azure.ai.agents 0.1.16-preview patch release (Azure#7141, Azure#7175, Azure#7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Remove registry.json changes - to be updated after builds are generated

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Add Breaking Changes section in CHANGELOG.md and move Azure#7181 under it

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
jongio pushed a commit to jongio/azure-dev that referenced this pull request Mar 27, 2026
…e#7141)

* Add file operations for hosted agent sessions (Azure#7132)

Add 'azd ai agent files' command group with upload, download, list, and
remove subcommands for managing session-scoped files on hosted agent
sandboxes. This enables debugging, seeding data, and agent setup.

New commands:
- files upload <remote-path> --path <local-path>
- files download <remote-path> [-o <output-path>]
- files list [remote-path] [--output json|table]
- files remove <remote-path> [--recursive]

All commands require --name, --version, and --session flags. Uses the
vnext API version (2025-11-15-preview) for session-scoped endpoints.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Copilot suggestion

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Modify files commands to not take name and version

Signed-off-by: trangevi <trangevi@microsoft.com>

* List fixes. Header fixes

Signed-off-by: trangevi <trangevi@microsoft.com>

* Add mkdir command. clean up parameters

Signed-off-by: trangevi <trangevi@microsoft.com>

* Linter

Signed-off-by: trangevi <trangevi@microsoft.com>

* Add stat command

Signed-off-by: trangevi <trangevi@microsoft.com>

* PR comment

Signed-off-by: trangevi <trangevi@microsoft.com>

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jongio pushed a commit to jongio/azure-dev that referenced this pull request Mar 27, 2026
* Initial plan

* Prepare azure.ai.agents 0.1.16-preview patch release (Azure#7141, Azure#7175, Azure#7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Remove registry.json changes - to be updated after builds are generated

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Add Breaking Changes section in CHANGELOG.md and move Azure#7181 under it

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
jongio pushed a commit to jongio/azure-dev that referenced this pull request Mar 27, 2026
…e#7141)

* Add file operations for hosted agent sessions (Azure#7132)

Add 'azd ai agent files' command group with upload, download, list, and
remove subcommands for managing session-scoped files on hosted agent
sandboxes. This enables debugging, seeding data, and agent setup.

New commands:
- files upload <remote-path> --path <local-path>
- files download <remote-path> [-o <output-path>]
- files list [remote-path] [--output json|table]
- files remove <remote-path> [--recursive]

All commands require --name, --version, and --session flags. Uses the
vnext API version (2025-11-15-preview) for session-scoped endpoints.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Copilot suggestion

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Modify files commands to not take name and version

Signed-off-by: trangevi <trangevi@microsoft.com>

* List fixes. Header fixes

Signed-off-by: trangevi <trangevi@microsoft.com>

* Add mkdir command. clean up parameters

Signed-off-by: trangevi <trangevi@microsoft.com>

* Linter

Signed-off-by: trangevi <trangevi@microsoft.com>

* Add stat command

Signed-off-by: trangevi <trangevi@microsoft.com>

* PR comment

Signed-off-by: trangevi <trangevi@microsoft.com>

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jongio pushed a commit to jongio/azure-dev that referenced this pull request Mar 27, 2026
* Initial plan

* Prepare azure.ai.agents 0.1.16-preview patch release (Azure#7141, Azure#7175, Azure#7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Remove registry.json changes - to be updated after builds are generated

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Add Breaking Changes section in CHANGELOG.md and move Azure#7181 under it

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
jongio pushed a commit to jongio/azure-dev that referenced this pull request Mar 27, 2026
…e#7141)

* Add file operations for hosted agent sessions (Azure#7132)

Add 'azd ai agent files' command group with upload, download, list, and
remove subcommands for managing session-scoped files on hosted agent
sandboxes. This enables debugging, seeding data, and agent setup.

New commands:
- files upload <remote-path> --path <local-path>
- files download <remote-path> [-o <output-path>]
- files list [remote-path] [--output json|table]
- files remove <remote-path> [--recursive]

All commands require --name, --version, and --session flags. Uses the
vnext API version (2025-11-15-preview) for session-scoped endpoints.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Copilot suggestion

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Modify files commands to not take name and version

Signed-off-by: trangevi <trangevi@microsoft.com>

* List fixes. Header fixes

Signed-off-by: trangevi <trangevi@microsoft.com>

* Add mkdir command. clean up parameters

Signed-off-by: trangevi <trangevi@microsoft.com>

* Linter

Signed-off-by: trangevi <trangevi@microsoft.com>

* Add stat command

Signed-off-by: trangevi <trangevi@microsoft.com>

* PR comment

Signed-off-by: trangevi <trangevi@microsoft.com>

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jongio pushed a commit to jongio/azure-dev that referenced this pull request Mar 27, 2026
* Initial plan

* Prepare azure.ai.agents 0.1.16-preview patch release (Azure#7141, Azure#7175, Azure#7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Remove registry.json changes - to be updated after builds are generated

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Add Breaking Changes section in CHANGELOG.md and move Azure#7181 under it

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
achauhan-scc pushed a commit to achauhan-scc/azure-dev that referenced this pull request Apr 2, 2026
…e#7141)

* Add file operations for hosted agent sessions (Azure#7132)

Add 'azd ai agent files' command group with upload, download, list, and
remove subcommands for managing session-scoped files on hosted agent
sandboxes. This enables debugging, seeding data, and agent setup.

New commands:
- files upload <remote-path> --path <local-path>
- files download <remote-path> [-o <output-path>]
- files list [remote-path] [--output json|table]
- files remove <remote-path> [--recursive]

All commands require --name, --version, and --session flags. Uses the
vnext API version (2025-11-15-preview) for session-scoped endpoints.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* PR comments

Signed-off-by: trangevi <trangevi@microsoft.com>

* Copilot suggestion

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Modify files commands to not take name and version

Signed-off-by: trangevi <trangevi@microsoft.com>

* List fixes. Header fixes

Signed-off-by: trangevi <trangevi@microsoft.com>

* Add mkdir command. clean up parameters

Signed-off-by: trangevi <trangevi@microsoft.com>

* Linter

Signed-off-by: trangevi <trangevi@microsoft.com>

* Add stat command

Signed-off-by: trangevi <trangevi@microsoft.com>

* PR comment

Signed-off-by: trangevi <trangevi@microsoft.com>

---------

Signed-off-by: trangevi <trangevi@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
achauhan-scc pushed a commit to achauhan-scc/azure-dev that referenced this pull request Apr 2, 2026
* Initial plan

* Prepare azure.ai.agents 0.1.16-preview patch release (Azure#7141, Azure#7175, Azure#7181)

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Remove registry.json changes - to be updated after builds are generated

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

* Add Breaking Changes section in CHANGELOG.md and move Azure#7181 under it

Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
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.

[agents extension] Add file operations for hosted agents

3 participants