aws / aws/agentcore-cli

`add agent --type byo` requires `--framework`, but the BYO path never uses it

Open Beginner friendly
#2,076 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
283
Forks
95
Avg merge
1d 2h
Merged PRs (30d)
183

Description

### Description

Non-interactive `agentcore add agent --type byo` rejects the invocation with `--framework is required` (and then `--model-provider is required`), but the BYO path never consumes the framework value: it is not written to agentcore.json, not used for packaging, and has no effect on the deployed runtime. Any value satisfies the check, so users are forced to pick a framework that is meaningless for bring-your-own code. The BYO example in docs/commands.md — which omits `--framework`, reasonably — fails as written because of this.

### Steps to Reproduce

1. Create a project:
```bash
agentcore create --name ByoRepro --no-agent
cd ByoRepro
```
2. Run the BYO example from docs/commands.md:
```bash
agentcore add agent --name MyAgent --type byo --code-location ./my-agent --entrypoint main.py --language Python
```
3. Observe `--framework is required`. Add any `--framework` value and observe the registered agent is identical regardless of which framework was given.

### Expected Behavior

The BYO path accepts the invocation without `--framework`, as shown in the docs example. A flag that is required should influence the result; one that cannot is not asked for.

### Actual Behavior

Validation fails with `--framework is required` (and `--model-provider is required` once a framework is supplied). Supplying e.g. `--framework Strands` vs `--framework LangChain_LangGraph` produces byte-identical agentcore.json entries.

### CLI Version

0.27.1

### Operating System

Linux

### Additional Context

Cause: the non-interactive validation in `src/cli/commands/add/validate.ts` applies its "Non-MCP protocols: validate framework" block to the BYO path as well, while `handleByoPath` in `src/cli/primitives/AgentPrimitive.tsx` never reads `options.framework`. `--model-provider` has a marginal BYO use (non-Bedrock values set up an API-key credential), so it may deserve a default rather than removal — maintainer's call.

Related: #2075 (BYO ignores `--language TypeScript`) — independent defect, same code path.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the BYO example from docs/commands.md, then read the non-interactive validation in src/cli/commands/add/validate.ts and the handleByoPath entry point in src/cli/primitives/AgentPrimitive.tsx. Done means the BYO command succeeds without --framework and framework values do not change the registered agent; preserve or clarify the separate --model-provider behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.