Skip to content

fix(aws-agents): bug bash skill fixes for AgentCore CLI v1 - #536

Merged
notgitika merged 30 commits into
gitika/agentcore-cli-v1from
gitika/bug-bash-skill-fixes
Nov 3, 2026
Merged

notgitika merged 30 commits into
gitika/agentcore-cli-v1from
gitika/bug-bash-skill-fixes

Conversation

@notgitika

Copy link
Copy Markdown
Contributor

Fixes skill guidance found during a bug bash of the AgentCore CLI v1 skill update (#502). Each finding was re-checked against @aws/agentcore 1.0.1 (CLI source, --help, and live runs where behavior mattered) and compared with the v0 skill on main and CLI 0.31.2. This PR contains only the skill-side fixes; CLI behavior issues are tracked separately.

One commit per fix, so individual changes are easy to review or drop.

amazon-bedrock (both copies, back in sync)

  • Make skills/core-skills match the plugin copy again (sync-plugin-skills.py --check was failing) and give a Harness JWT authorizer example the CLI accepts (it needs at least one of allowedAudience / allowedClients / allowedScopes / customClaims).
  • Note that additionalParams is LiteLLM-only in v1 projects.
  • Render gate now matches only unrendered {{TOKEN}} / <<< markers, so a correctly rendered shim passes.
  • Use real IAM actions bedrock:Retrieve / bedrock:InvokeAgent (the bedrock-agent-runtime: prefix does not exist).
  • Fix a dangling section reference in the migration guide.

agents-build

  • Memory examples send actorId (what the templates read); invoke --user-id does not set the Memory actor in v1.
  • call_specialist parses the template's SSE stream (and raises on stream errors) instead of json.loads.
  • Multi-agent IAM grants the endpoint ARN (<arn>/runtime-endpoint/*), which is what the call is authorized on.
  • A2A client reads results from (Task, update) tuples / Part.root.text (a2a-sdk 0.3.x).
  • Correct InvokeAgentRuntimeCommand example (body=, response["stream"]) and mention agentcore runtime exec / shell.
  • IAM examples use the deployed Runtime ARN from agentcore status --json (<project>_<target>_<runtime>-<id>).
  • Retarget section references removed by the agents-connect rewrite; warn about endpoint versions on a new staging target.

agents-connect / agents-debug / agents-get-started / agents-harden

  • Explain that a default (protocolType: None) Gateway URL needs /mcp, and add Strands MCP client examples for AWS_IAM (SigV4) and CUSTOM_JWT.
  • Pass --attach-mode log-only when attaching a policy engine (v1 defaults to enforce).
  • Read LOG_ONLY policy decisions from CloudWatch metrics (AllowDecisions / DenyDecisions), not non-existent decision logs.
  • Correct the Gateway outbound-auth matrix (lambdaFunctionArn uses the Gateway IAM role; shortcut targets reject api-key).
  • Cover invalid/stale model identifiers; v1 Runtime ARN shape; retarget dangling section references.

agents-deploy / agents-optimize

  • Runtime endpoint versions in agentcore.json apply to every target; explain the first-deploy-to-a-new-target rollback and how to find the real cause behind NoStack.
  • "Memory stuck in CREATING": back up and restore the full memory entry, and warn that remove + deploy deletes stored memory.
  • "Model identifier is invalid" is a wrong model ID, not missing model access.
  • CI quality gate fails on missing sessions, failed dataset examples, and categorical results; polls with agentcore runtime traces list --id (works outside a project).
  • Note that one unsupported session aborts eval ondemand evaluate; use --session-ids or batch evaluation.

agents-pay

  • The runtime reads only the OS user's default config path; describe switching targets accordingly (and fix the script's hint).
  • IAM verification uses a fail-closed simulate-principal-policy against the Runtime execution role, and states that default CLI wiring grants it CreatePaymentSession.

Checks

tools/validate.py, tools/sync-plugin-skills.py --check, markdownlint on changed files, git diff --check, tool tests and payment-script tests all pass. Changed code snippets were executed (locally, against agentcore dev, or against previously recorded live responses).

gitikavj added 30 commits November 3, 2026 19:06
Port the authorizer flag casing fix to the canonical core-skills copy so both
copies match, and add allowedAudience to the example because the v1 CLI
rejects a discoveryUrl-only customJwtAuthorizer.
…in v1 projects

The CreateHarness API accepts additionalParams on every model variant, but the
v1 project schema rejects it for bedrock, open_ai, and gemini.
…tokens

Grep for {{UPPER_CASE}} tokens and <<< markers instead of any {{ or }}, which
valid rendered Python and JSON contain, and drop the literal token from the
Lambda shim docstring so a correctly rendered file passes.
…Agent

IAM has no bedrock-agent-runtime service prefix, so policies built from the
migration guidance failed validation. Keep bedrock-agent-runtime only as the
API client name.
…gration guide

Point at the deploy.md first-deploy section and name the --region flag instead
of a section that no longer exists.
…paths

The payment runtime always reads ~/.agents-pay/config.json of its OS account,
so a separate --path per target never takes effect. Use one OS account per
target or re-run init-config --force when switching.
… IAM simulation

The old grep check passed on lookup errors and inspected a role that never
holds CreatePaymentSession. Simulate against the Runtime execution role and
note that default CLI wiring grants it both session and payment actions.
The v1 Strands templates read the actor from payload actorId and fall back to
the shared actor default; userId and invoke --user-id are ignored.
…cialist

The Strands template responds with text/event-stream, so json.loads on the
body failed. Join the SSE text deltas and keep the JSON branch for dict returns.
Match the payload field the v1 Strands templates read for the Memory actor,
and note that invoke --user-id does not set it.
…t ARN

InvokeAgentRuntime is authorized on <runtime-arn>/runtime-endpoint/<qualifier>,
so an exact runtime ARN alone is denied.
With a2a-sdk 0.3, send_message yields (Task, update) tuples for task responses
and Part is a RootModel, so the text is on artifact parts' root.
The API takes the command in body and returns an event stream of stdout/stderr
deltas. Also point to agentcore runtime exec and runtime shell.
The deployed Runtime name is <project>_<target>_<runtime>-<id>, not the
logical name. Take the ARN from agentcore status and cover the endpoint ARN.
Point credential references at the agents-connect outbound authentication step
and the payments onboarding tag check at Step 2, where the tag is added.
…nt example

A default Gateway (protocolType None) has a bare-origin URL; MCP clients must
append /mcp. Restore a Strands MCPClient example that signs SigV4 for AWS_IAM
Gateways and a bearer-header variant for CUSTOM_JWT.
…gine

v1 attaches a policy engine in ENFORCE by default, so an engine without a
permit denies every tool call. Say so and use log-only in the example.
The CLI sets up no Gateway decision log. Point to the AllowDecisions and
DenyDecisions metrics (Mode=LOG_ONLY) with list/get commands, or ENFORCE testing.
lambdaFunctionArn targets take no outboundAuth (gateway IAM role), and the
shortcut target forms reject api-key; API_KEY is only set in full JSON config.
The agents-connect rewrite replaced its named sections with numbered steps;
point get-started, harden, and debug at the current headings.
Deployed Runtimes are named <project>_<target>_<runtime>-<id>; take the
exact ARN from agentcore status --json.
Add the ValidationException 'provided model identifier is invalid' cause with
commands to check the ID against the region's profiles and models.
…argets

Endpoint versions in agentcore.json apply to every target, but a new target only has version 1, so its first deploy rolls back with a 404 on the endpoint. Document the workaround and add the NoStack rollback and endpoint-not-found patterns to Path B.
… memory

Re-adding a memory with only --name drops its strategies and other settings. Back up and restore the full memories[] entry, and warn that remove plus deploy deletes the stored memory data.
This error means the model ID or inference profile is mistyped, stale, or not offered in the region, not that model access is missing. Point to the Check 3 commands instead of the console access page.
Compare sessionsEvaluated with the session IDs the tests used, fail on dataset examples that could not be invoked, and report categorical results instead of treating them as errors. Poll with the project-free runtime traces command so the gate runs outside a checkout.
…mand evaluation

A session with no supported-framework spans, such as one from a failed invoke, makes ondemand evaluate exit with no results. Recommend known-good session IDs or batch evaluation, and add the error to Troubleshooting.
Runtime endpoint versions are shared across targets, so a first deploy to a new target fails when an endpoint points past version 1.
init-config --force refuses a config written for another target, and the runtime ignores --path, so point users at moving the config aside instead.
…and surface specialist stream errors

Deployed Runtime names replace hyphens in the target name with underscores, and call_specialist now raises on an error event instead of returning an empty string.
@notgitika
notgitika requested review from a team as code owners November 3, 2026 19:22
@notgitika
notgitika merged commit 5dca534 into gitika/agentcore-cli-v1 Nov 3, 2026
3 checks passed
@notgitika
notgitika deleted the gitika/bug-bash-skill-fixes branch November 3, 2026 20:26
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.

2 participants