Skip to content

feat: add archive command for batch evaluations and recommendations#1112

Merged
padmak30 merged 3 commits intomainfrom
feat/archive
May 4, 2026
Merged

feat: add archive command for batch evaluations and recommendations#1112
padmak30 merged 3 commits intomainfrom
feat/archive

Conversation

@padmak30
Copy link
Copy Markdown
Contributor

@padmak30 padmak30 commented May 4, 2026

Description

  • Introduces a new top-level archive command with two subcommands: archive batch-evaluation and archive recommendation. Each calls the corresponding service delete API and removes the matching local .cli/
    history file.

    • Extracts a shared getRegion() helper into src/cli/commands/shared/region-utils.ts, removing duplicate implementations from pause/command.tsx and stop/command.tsx.
    • Adds src/cli/operations/archive/archive-storage.ts with deleteLocalBatchEvalRun and deleteLocalRecommendationRun, locating per-ID JSON files in agentcore/.cli/batch-eval-results/ and
      agentcore/.cli/recommendations/ and deleting them. Exports BATCH_EVAL_RESULTS_DIR and RECOMMENDATIONS_DIR from their existing storage modules to enable this.
    • Registers archive in CLI_ONLY_COMMANDS in TUI utils — consistent with stop, pause, resume.
  • Usage

    • Archive a batch evaluation (deletes from service and clears local history)
      agentcore archive batch-evaluation --id

    • Archive a recommendation
      agentcore archive recommendation --id

    • With explicit region
      agentcore archive batch-evaluation --id --region us-west-2

    • JSON output for scripting
      agentcore archive batch-evaluation --id --json
      agentcore archive recommendation --id --json

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change? Added unit tests and e2e tests

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

@padmak30 padmak30 requested a review from a team May 4, 2026 19:14
@github-actions github-actions Bot added size/xl PR size: XL agentcore-harness-reviewing AgentCore Harness review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 43.04% 8989 / 20883
🔵 Statements 42.32% 9544 / 22550
🔵 Functions 39.86% 1550 / 3888
🔵 Branches 39.92% 5794 / 14511
Generated in workflow #2374 for commit ccb556c by the Vitest Coverage Report Action

@agentcore-cli-automation
Copy link
Copy Markdown

The new archive subcommands call DeleteBatchEvaluation and DeleteRecommendation, but docs/policies/iam-policy-user.json (the BatchEvalAndRecommendation statement that was just synced in #1092) doesn't include those IAM actions. Users following the documented IAM policy won't be able to run archive.

Please add bedrock-agentcore:DeleteBatchEvaluation and bedrock-agentcore:DeleteRecommendation to that statement. (Same gap exists today for stop batch-evaluation / StopBatchEvaluation — might be worth fixing in the same commit since #1092 just reconciled this policy.)

@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels May 4, 2026
notgitika
notgitika previously approved these changes May 4, 2026
Copy link
Copy Markdown
Contributor

@notgitika notgitika left a comment

Choose a reason for hiding this comment

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

LGTM thank you!

Wonder if we can see any use case where this can be extended to some other resources in the CLI. Curious your thoughts!

Comment thread src/cli/operations/archive/archive-storage.ts
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels May 4, 2026
@notgitika notgitika self-requested a review May 4, 2026 20:49
Copy link
Copy Markdown
Contributor

@notgitika notgitika left a comment

Choose a reason for hiding this comment

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

LGTM

@padmak30 padmak30 merged commit 7586092 into main May 4, 2026
25 checks passed
@padmak30 padmak30 deleted the feat/archive branch May 4, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xl PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants