Skip to content

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

Description

@iwamot

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:
    agentcore create --name ByoRepro --no-agent
    cd ByoRepro
  2. Run the BYO example from docs/commands.md:
    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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions