[Agents Extension] Add support for logs and status commands - #6895
Conversation
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
Signed-off-by: trangevi <trangevi@microsoft.com>
There was a problem hiding this comment.
Pull request overview
This PR adds two new commands to the Azure AI Agents extension: logs and status. These commands enable users to retrieve logs and status information from hosted agent containers.
Changes:
- Adds
GetAgentContainerLogStreamAPI operation to stream logs from agent containers with support for different log types (console/system) and configurable tail length - Introduces new model structs (
AgentContainerReplicaState,AgentContainerDetails) and enhancesAgentContainerObjectto support detailed container runtime information - Implements shared
AgentContexthelper for common agent command patterns including endpoint resolution and client creation - Adds
statuscommand with JSON and table output formats to display agent container status, replica configuration, and error messages - Adds
logscommand to fetch console or system logs from agent containers - Includes comprehensive test coverage for both commands
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
operations.go |
Adds GetAgentContainerLogStream method to fetch logs via streaming API endpoint |
models.go |
Adds AgentContainerReplicaState and AgentContainerDetails structs; extends AgentContainerObject with ID and Container fields |
agent_context.go |
New shared context helper encapsulating endpoint resolution, credential creation, and client factory for agent commands |
status.go |
Implements status command with JSON/table output formats to display container status and runtime details |
status_test.go |
Comprehensive unit tests for status command, including flag validation, output formatting, and endpoint resolution |
get_logs.go |
Implements logs command with validation for tail (1-300) and type (console/system) parameters |
get_logs_test.go |
Unit tests for logs command covering flag validation, boundary conditions, and default values |
root.go |
Registers new status and logs commands with the root command |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@tg-msft @therealjohn @wbreza @kristenwomack @JeffreyCA Remember we discussed about using already existing core command naming conventions for status and logs as show and monitor respectively.
This will enable us to eventually have overriding behaviors like we did for azd deploy. So we can land at azd show, azd monitor etc |
Signed-off-by: trangevi <trangevi@microsoft.com>
vhvb1989
left a comment
There was a problem hiding this comment.
pretty cool - I will take this as inspiration to add stream to the appservice extension
Signed-off-by: trangevi <trangevi@microsoft.com>
…pi/operations.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…re-dev into trangevi/logs-commands
Uh oh!
There was an error while loading. Please reload this page.