You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR revamps the status command to now factor in all resources.
You don't have to have an agent in the project to run status anymore.
Show resources agents, memory, credentials, gateways and gateway targets
Display resource IDs and ARNs if deployed
Differentiate between local, deployed and (deployed, removed but not deployed again to apply changes) for each resource
Add status logs in the agentcore/.cli/logs/status/ folder
Update agentcore status options. New options are:
--type -- Filter by resource type (agent, memory, credential, gateway)
--state -- Filter by deployment state (deployed, local-only, pending-removal)
--agent -- Show only the named agent (other resource types still shown)
--json -- Output full result as JSON
Here is what it looks like:
Log file:
Non-interactive command:
Options:
agentcore status --help
Usage: agentcore status|s [options]
Retrieve details of deployed AgentCore resources.
Options:
--agent-runtime-id <id> Look up a specific agent runtime by ID
--target <name> Select deployment target
--type <type> Filter by resource type (agent, memory, credential, gateway)
--state <state> Filter by deployment state (deployed, local-only, pending-removal)
--agent <name> Filter to a specific agent
--json Output as JSON
-h, --help Display help
Run without flags for interactive mode. Flags marked [non-interactive] trigger CLI mode.
Run `agentcore help modes` for details.
I've completed my review of this PR. Overall, this is a well-implemented feature that significantly improves the agentcore status command. The changes are well-structured, thoroughly tested, and address all requirements from issue #473.
✅ Strengths
Excellent test coverage - 303 lines of comprehensive unit tests covering all deployment states and resource types
Clean architecture - Good separation between action logic, command registration, and UI components
The diffResourceSet function is clever and generic, but would benefit from documentation explaining the algorithm:
/** * Compares local and deployed resource sets to compute deployment states. * * Algorithm: * 1. For each local resource: mark as 'deployed' if in deployedRecord, else 'local-only' * 2. For each deployed resource not in local set: mark as 'pending-removal' * * @returns Array of ResourceStatusEntry with computed deployment states */functiondiffResourceSet<TLocalextends{name: string},TDeployed>({ ... })
suggestion: Extract validation logic to action layer
Input validation currently happens in the command layer with direct rendering. Consider moving validation to the action layer for better separation and testability:
// In action.tsexportfunctionvalidateStatusOptions(options: StatusCliOptions): {valid: boolean;error?: string}{if(options.type&&!VALID_RESOURCE_TYPES.includes(options.type)){return{valid: false,error: `Invalid resource type '${options.type}'. Valid types: ${VALID_RESOURCE_TYPES.join(', ')}`};}// ... other validationsreturn{valid: true};}
suggestion: Consider adding integration test
File: New file needed
The PR includes excellent unit tests, but an integration test would help verify the end-to-end flow with real AWS config files. Consider adding:
// integ-tests/status.test.tsit('should show all resource types with correct deployment states',async()=>{// Create project with mixed deployed/local resources// Run status command// Verify output shows correct states});
The code mutates the resources array by index during parallel runtime status fetches. While this works, it could be more explicit:
// Instead of: resources[i] = { ...entry, detail: runtimeStatus.status };// Consider: Track updates in a Map and merge after Promise.allconstupdates=newMap<number,Partial<ResourceStatusEntry>>();awaitPromise.all(resources.map(async(entry,i)=>{// ... fetch status ...updates.set(i,{detail: runtimeStatus.status});}));// Apply updatesupdates.forEach((update,i)=>{resources[i]={ ...resources[i], ...update};});
nit: Consistent color usage
File: src/cli/tui/components/ResourceGraph.tsx
The code imports DEPLOYMENT_STATE_COLORS from theme for consistency, but still uses magic strings like 'green', 'red', 'blue' for icon colors. Consider using theme constants throughout.
🎯 Questions
question: How does pending-removal state persist?
If a resource is removed from agentcore.json, how does the status command know it was previously deployed? I see it reads from deployed-state.json, but what happens after the user runs deploy to remove it? Does the entry get cleaned up from deployed-state.json?
question: Filter behavior with non-existent resources
What happens if a user runs agentcore status --agent nonexistent-agent? Should it show an error or just show empty results with other resource types?
Verdict
No blocking issues found. This PR is ready to merge after addressing any of the suggestions the team deems important. Great work! 🚀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR revamps the status command to now factor in all resources.
agentcore/.cli/logs/status/folderagentcore statusoptions. New options are:Here is what it looks like:
Log file:
Non-interactive command:
Options:
agentcore status --helpRelated Issue
Closes #473
Documentation PR
N/A
Type of Change
Testing
How have you tested the change?
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.