Skip to content

fix(pause-online-insights): reject mismatched --name and --arn#1601

Merged
jariy17 merged 3 commits into
aws:mainfrom
notgitika:fix/pause-online-insights-name-arn
Jun 29, 2026
Merged

fix(pause-online-insights): reject mismatched --name and --arn#1601
jariy17 merged 3 commits into
aws:mainfrom
notgitika:fix/pause-online-insights-name-arn

Conversation

@notgitika

@notgitika notgitika commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

When both a config name argument and --arn were passed to agentcore pause online-insights / agentcore resume online-insights, the ARN silently won and the name was ignored. If the two referred to different configs, the wrong config was paused with no error.

Now resolveConfig cross-checks: if both are provided, the named config is looked up and its configId must match the ARN's. Mismatches return a clear error showing which config each side resolves to. Passing only one (or matching values) is unchanged.

Bug: "--arn and config name accept mismatched values without checking."

When both a config name and --arn were passed to `agentcore pause/resume
online-insights`, the ARN silently won and the name was ignored. If they
referred to different configs, the wrong config was paused with no
warning.

Now we cross-check: if both are provided, look up the named config and
verify its configId matches the ARN's. Mismatches return a clear error
explaining which config each side resolves to. Passing only one (or
matching values) continues to work.

Bug bash item aws#15 (P1).
@notgitika notgitika requested a review from a team June 22, 2026 03:03
@github-actions github-actions Bot added the size/s PR size: S label Jun 22, 2026
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 22, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jun 22, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jun 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.20.2.tgz

How to install

gh release download pr-1601-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.20.2.tgz

@agentcore-cli-automation agentcore-cli-automation left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice targeted fix for a real footgun — silently picking the ARN when both were passed was the worst-of-both-worlds behavior. Two concerns worth addressing before merge around how the new cross-validation interacts with the --arn-without-project flow and how thoroughly it cross-checks the two inputs (details inline).

One side note (not introduced by this PR but now affects the new code path): in handlePauseResume, every resolution error is wrapped as ResourceNotFoundError at line 111. The mismatch error this PR adds is a validation/argument error, not a missing-resource error — there's a ValidationError class in src/lib/errors/types.ts that's a better fit and would give telemetry / error-classification downstream the right signal. Feel free to defer if you'd rather keep this PR scoped, but worth a follow-up.

Comment thread src/cli/operations/eval/pause-resume.ts
Comment thread src/cli/operations/eval/pause-resume.ts
@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Jun 22, 2026
Addresses review feedback:
- requireProject() is now called whenever a config name is provided,
  even alongside --arn, so the user gets a clear error outside a project.
- Region mismatch between name resolution and ARN is now rejected,
  closing the same class of silent inconsistency on the region axis.
@github-actions github-actions Bot added size/s PR size: S and removed size/s PR size: S labels Jun 29, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jun 29, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jun 29, 2026
@github-actions github-actions Bot removed the size/s PR size: S label Jun 29, 2026
@github-actions github-actions Bot added the size/s PR size: S label Jun 29, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jun 29, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jun 29, 2026
@jariy17 jariy17 merged commit 7ba3657 into aws:main Jun 29, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants