Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Main project configuration using a **flat resource model**. Agents, memories, an
"build": "CodeZip",
"entrypoint": "main.py",
"codeLocation": "app/MyAgent/",
"runtimeVersion": "PYTHON_3_13",
"runtimeVersion": "PYTHON_3_14",
"networkMode": "PUBLIC",
"protocol": "HTTP"
}
Expand Down Expand Up @@ -166,7 +166,7 @@ on the next deployment.
"build": "CodeZip",
"entrypoint": "main.py",
"codeLocation": "app/MyAgent/",
"runtimeVersion": "PYTHON_3_13",
"runtimeVersion": "PYTHON_3_14",
"networkMode": "PUBLIC",
"envVars": [{ "name": "MY_VAR", "value": "my-value" }],
"instrumentation": {
Expand Down Expand Up @@ -201,6 +201,7 @@ on the next deployment.
- `PYTHON_3_11`
- `PYTHON_3_12`
- `PYTHON_3_13`
- `PYTHON_3_14`

**Node.js:**

Expand Down
2 changes: 1 addition & 1 deletion docs/container-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ In `agentcore.json`, set `"build": "Container"`:
"build": "Container",
"entrypoint": "main.py",
"codeLocation": "app/MyAgent/",
"runtimeVersion": "PYTHON_3_13"
"runtimeVersion": "PYTHON_3_14"
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4002,7 +4002,7 @@ file maps to a JSON config file and includes validation constraints as comments.

- **BuildType**: \`'CodeZip'\` | \`'Container'\`
- **NetworkMode**: \`'PUBLIC'\`
- **RuntimeVersion**: \`'PYTHON_3_10'\` | \`'PYTHON_3_11'\` | \`'PYTHON_3_12'\` | \`'PYTHON_3_13'\`
- **RuntimeVersion**: \`'PYTHON_3_10'\` | \`'PYTHON_3_11'\` | \`'PYTHON_3_12'\` | \`'PYTHON_3_13'\` | \`'PYTHON_3_14'\`
- **MemoryStrategyType**: \`'SEMANTIC'\` | \`'SUMMARIZATION'\` | \`'USER_PREFERENCE'\` | \`'EPISODIC'\`

### Build Types
Expand Down
2 changes: 1 addition & 1 deletion src/assets/agents/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ file maps to a JSON config file and includes validation constraints as comments.

- **BuildType**: `'CodeZip'` | `'Container'`
- **NetworkMode**: `'PUBLIC'`
- **RuntimeVersion**: `'PYTHON_3_10'` | `'PYTHON_3_11'` | `'PYTHON_3_12'` | `'PYTHON_3_13'`
- **RuntimeVersion**: `'PYTHON_3_10'` | `'PYTHON_3_11'` | `'PYTHON_3_12'` | `'PYTHON_3_13'` | `'PYTHON_3_14'`
- **MemoryStrategyType**: `'SEMANTIC'` | `'SUMMARIZATION'` | `'USER_PREFERENCE'` | `'EPISODIC'`

### Build Types
Expand Down
1 change: 1 addition & 0 deletions src/cli/commands/import/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ export const RUNTIME_TYPE_MAP: Record<string, string> = {
PYTHON_3_11: 'PYTHON_3_11',
PYTHON_3_12: 'PYTHON_3_12',
PYTHON_3_13: 'PYTHON_3_13',
PYTHON_3_14: 'PYTHON_3_14',
};
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('mapGenerateConfigToAgent', () => {
expect(result.name).toBe('TestProject');
expect(result.build).toBe('CodeZip');
expect(result.entrypoint).toBe('main.py');
expect(result.runtimeVersion).toBe('PYTHON_3_13');
expect(result.runtimeVersion).toBe('PYTHON_3_14');
expect(result.networkMode).toBe('PUBLIC');
expect(result.protocol).toBe('HTTP');
});
Expand Down
10 changes: 8 additions & 2 deletions src/cli/primitives/AgentPrimitive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ import type {
SDKFramework,
TargetLanguage,
} from '../../schema';
import { AgentEnvSpecSchema, CREDENTIAL_PROVIDERS, LIFECYCLE_TIMEOUT_MAX, LIFECYCLE_TIMEOUT_MIN } from '../../schema';
import {
AgentEnvSpecSchema,
CREDENTIAL_PROVIDERS,
DEFAULT_PYTHON_VERSION,
LIFECYCLE_TIMEOUT_MAX,
LIFECYCLE_TIMEOUT_MIN,
} from '../../schema';
import type { AddAgentOptions as CLIAddAgentOptions } from '../commands/add/types';
import { validateAddAgentOptions } from '../commands/add/validate';
import { parseAndNormalizeHeaders } from '../commands/shared/header-utils';
Expand Down Expand Up @@ -526,7 +532,7 @@ export class AgentPrimitive extends BasePrimitive<AddAgentOptions, RemovableReso
build: options.buildType,
entrypoint: (options.entrypoint ?? 'main.py') as FilePath,
codeLocation: codeLocation as DirectoryPath,
runtimeVersion: 'PYTHON_3_13',
runtimeVersion: DEFAULT_PYTHON_VERSION,
protocol,
networkMode,
...(networkMode === 'VPC' &&
Expand Down
2 changes: 1 addition & 1 deletion src/cli/tui/screens/agent/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,5 @@ export const NETWORK_MODE_OPTIONS = [
{ id: 'VPC', title: 'VPC', description: 'Attach to your VPC' },
] as const;

export const DEFAULT_PYTHON_VERSION: PythonRuntime = 'PYTHON_3_13';
export { DEFAULT_PYTHON_VERSION } from '../../../../schema';
export const DEFAULT_ENTRYPOINT = 'main.py';
7 changes: 3 additions & 4 deletions src/cli/tui/screens/generate/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { NetworkMode, PythonRuntime } from '../../../../schema';
import type { NetworkMode } from '../../../../schema';

export { DEFAULT_PYTHON_VERSION } from '../../../../schema';

/**
* Default configuration values for create command
*/

/** Default Python runtime version for new agents */
export const DEFAULT_PYTHON_VERSION: PythonRuntime = 'PYTHON_3_13';

/** Default network mode for agent runtimes */
export const DEFAULT_NETWORK_MODE: NetworkMode = 'PUBLIC';

Expand Down
6 changes: 3 additions & 3 deletions src/cli/tui/screens/mcp/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type {
GatewayPolicyEngineConfiguration,
GatewayTargetType,
NodeRuntime,
PythonRuntime,
SchemaSource,
ToolDefinition,
} from '../../../../schema';
Expand Down Expand Up @@ -278,7 +277,8 @@ export const POLICY_ENGINE_MODE_OPTIONS = [
] as const;

export const PYTHON_VERSION_OPTIONS = [
{ id: 'PYTHON_3_13', title: 'Python 3.13', description: 'Latest' },
{ id: 'PYTHON_3_14', title: 'Python 3.14', description: 'Latest' },
{ id: 'PYTHON_3_13', title: 'Python 3.13', description: '' },
{ id: 'PYTHON_3_12', title: 'Python 3.12', description: '' },
{ id: 'PYTHON_3_11', title: 'Python 3.11', description: '' },
{ id: 'PYTHON_3_10', title: 'Python 3.10', description: '' },
Expand All @@ -294,6 +294,6 @@ export const NODE_VERSION_OPTIONS = [
// Defaults
// ─────────────────────────────────────────────────────────────────────────────

export const DEFAULT_PYTHON_VERSION: PythonRuntime = 'PYTHON_3_13';
export { DEFAULT_PYTHON_VERSION } from '../../../../schema';
export const DEFAULT_NODE_VERSION: NodeRuntime = 'NODE_20';
export const DEFAULT_HANDLER = 'handler.lambda_handler';
4 changes: 4 additions & 0 deletions src/lib/packaging/__tests__/python.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ describe('extractPythonVersion', () => {
expect(extractPythonVersion('PYTHON_3_13' as PythonRuntime)).toBe('3.13');
});

it('extracts 3.14 from PYTHON_3_14', () => {
expect(extractPythonVersion('PYTHON_3_14' as PythonRuntime)).toBe('3.14');
});

it('throws for unsupported runtime string', () => {
expect(() => extractPythonVersion('RUBY_3_0' as PythonRuntime)).toThrow('Unsupported Python runtime');
});
Expand Down
14 changes: 14 additions & 0 deletions src/lib/packaging/__tests__/uv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ describe('detectUnavailablePlatform', () => {
expect(issue!.message).toContain('has no wheels');
});

it('detects "no wheels with a matching Python ABI tag" message (e.g. cp314)', () => {
const out = 'numpy==2.4.4 has no wheels with a matching Python ABI tag (e.g., `cp314`)';
const issue = detectUnavailablePlatform(result(out));
expect(issue).not.toBeNull();
expect(issue!.message).toContain('cp314');
});

it('detects "has no usable wheels" message', () => {
const out = 'numpy>=1.10.4 has no usable wheels, we can conclude that numpy>=1.10.4 cannot be used.';
const issue = detectUnavailablePlatform(result(out));
expect(issue).not.toBeNull();
expect(issue!.message).toContain('usable wheels');
});

it('returns null for successful output', () => {
const out = 'Successfully installed package-1.0.0\nAll done!';
expect(detectUnavailablePlatform({ code: 0, stdout: out, stderr: '', signal: null })).toBeNull();
Expand Down
3 changes: 2 additions & 1 deletion src/lib/packaging/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { AgentCoreProjectSpec, AgentEnvSpec, RuntimeVersion } from '../../schema';
import { DEFAULT_PYTHON_VERSION } from '../../schema';
import { ContainerPackager } from './container';
import { PackagingError } from './errors';
import { isNodeRuntime, isPythonRuntime } from './helpers';
Expand Down Expand Up @@ -78,7 +79,7 @@ export async function packRuntime(spec: AgentEnvSpec, options?: PackageOptions):
* Defaults to Python if no runtimeVersion is specified.
*/
export function packCodeZipSync(config: CodeBundleConfig | AgentEnvSpec, options?: PackageOptions): ArtifactResult {
const runtimeVersion = config.runtimeVersion ?? 'PYTHON_3_13';
const runtimeVersion = config.runtimeVersion ?? DEFAULT_PYTHON_VERSION;
const packager = getCodeZipPackager(runtimeVersion);
return packager.packCodeZip(config as AgentEnvSpec, options);
}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/packaging/python.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { AgentEnvSpec, PythonRuntime, RuntimeVersion } from '../../schema';
import { DEFAULT_PYTHON_VERSION } from '../../schema';
import { UV_INSTALL_HINT, getArtifactZipName } from '../constants';
import { runSubprocessCapture, runSubprocessCaptureSync } from '../utils/subprocess';
import { PackagingError } from './errors';
Expand Down Expand Up @@ -155,7 +156,7 @@ export class PythonCodeZipPackager implements RuntimePackager {
*/
export class PythonCodeZipPackagerSync implements CodeZipPackager {
packCodeZip(config: AgentEnvSpec, options: PackageOptions = {}): ArtifactResult {
const runtimeVersion = config.runtimeVersion ?? 'PYTHON_3_13';
const runtimeVersion = config.runtimeVersion ?? DEFAULT_PYTHON_VERSION;

if (!isPythonRuntimeVersion(runtimeVersion)) {
throw new PackagingError(`Python packager only supports Python runtimes. Received: ${runtimeVersion}`);
Expand Down
3 changes: 2 additions & 1 deletion src/lib/packaging/uv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export interface PlatformIssue {

const PLATFORM_HINT_REGEX = /platforms:\s*([^\n]+)/i;
const MANYLINUX_TOKEN = /(manylinux[^\s,]+)/gi;
const NO_WHEELS_REGEX = /(has no wheels with a matching platform tag|no compatible (?:wheels|tags) found)/i;
const NO_WHEELS_REGEX =
/(has no wheels with a matching (?:platform|Python ABI) tag|no compatible (?:wheels|tags) found|has no usable wheels)/i;

export function detectUnavailablePlatform(result: SubprocessResult): PlatformIssue | null {
const combined = `${result.stdout}\n${result.stderr}`;
Expand Down
4 changes: 2 additions & 2 deletions src/schema/__tests__/constants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ describe('ModelProviderSchema', () => {
});

describe('PythonRuntimeSchema', () => {
it.each(['PYTHON_3_10', 'PYTHON_3_11', 'PYTHON_3_12', 'PYTHON_3_13'])('accepts "%s"', version => {
it.each(['PYTHON_3_10', 'PYTHON_3_11', 'PYTHON_3_12', 'PYTHON_3_13', 'PYTHON_3_14'])('accepts "%s"', version => {
expect(PythonRuntimeSchema.safeParse(version).success).toBe(true);
});

it('rejects unsupported versions', () => {
expect(PythonRuntimeSchema.safeParse('PYTHON_3_9').success).toBe(false);
expect(PythonRuntimeSchema.safeParse('PYTHON_3_14').success).toBe(false);
expect(PythonRuntimeSchema.safeParse('PYTHON_3_15').success).toBe(false);
});
});

Expand Down
5 changes: 4 additions & 1 deletion src/schema/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,12 @@ export function isReservedProjectName(name: string): boolean {
// Infrastructure Constants (shared between agent-env and mcp schemas)
// ============================================================================

export const PythonRuntimeSchema = z.enum(['PYTHON_3_10', 'PYTHON_3_11', 'PYTHON_3_12', 'PYTHON_3_13']);
export const PythonRuntimeSchema = z.enum(['PYTHON_3_10', 'PYTHON_3_11', 'PYTHON_3_12', 'PYTHON_3_13', 'PYTHON_3_14']);
export type PythonRuntime = z.infer<typeof PythonRuntimeSchema>;

/** Default Python runtime version for new agents and MCP tools */
export const DEFAULT_PYTHON_VERSION: PythonRuntime = 'PYTHON_3_14';

export const NodeRuntimeSchema = z.enum(['NODE_18', 'NODE_20', 'NODE_22']);
export type NodeRuntime = z.infer<typeof NodeRuntimeSchema>;

Expand Down
2 changes: 1 addition & 1 deletion src/schema/llm-compacted/agentcore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface AgentCoreProjectSpec {
// ─────────────────────────────────────────────────────────────────────────────

type BuildType = 'CodeZip' | 'Container';
type PythonRuntime = 'PYTHON_3_10' | 'PYTHON_3_11' | 'PYTHON_3_12' | 'PYTHON_3_13';
type PythonRuntime = 'PYTHON_3_10' | 'PYTHON_3_11' | 'PYTHON_3_12' | 'PYTHON_3_13' | 'PYTHON_3_14';
type NodeRuntime = 'NODE_18' | 'NODE_20' | 'NODE_22';
type RuntimeVersion = PythonRuntime | NodeRuntime;
type NetworkMode = 'PUBLIC' | 'VPC';
Expand Down
2 changes: 1 addition & 1 deletion src/schema/llm-compacted/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,6 @@ interface IamPolicyDocument {
// ─────────────────────────────────────────────────────────────────────────────

type GatewayTargetType = 'lambda' | 'mcpServer' | 'openApiSchema' | 'smithyModel' | 'apiGateway' | 'lambdaFunctionArn';
type PythonRuntime = 'PYTHON_3_10' | 'PYTHON_3_11' | 'PYTHON_3_12' | 'PYTHON_3_13';
type PythonRuntime = 'PYTHON_3_10' | 'PYTHON_3_11' | 'PYTHON_3_12' | 'PYTHON_3_13' | 'PYTHON_3_14';
type NodeRuntime = 'NODE_18' | 'NODE_20' | 'NODE_22';
type NetworkMode = 'PUBLIC' | 'VPC';
2 changes: 1 addition & 1 deletion src/schema/schemas/__tests__/agent-env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ describe('AgentEnvSpecSchema', () => {
});

it('accepts agent with all Python runtime versions', () => {
for (const version of ['PYTHON_3_10', 'PYTHON_3_11', 'PYTHON_3_12', 'PYTHON_3_13']) {
for (const version of ['PYTHON_3_10', 'PYTHON_3_11', 'PYTHON_3_12', 'PYTHON_3_13', 'PYTHON_3_14']) {
const result = AgentEnvSpecSchema.safeParse({ ...validPythonAgent, runtimeVersion: version });
expect(result.success, `Should accept ${version}`).toBe(true);
}
Expand Down
3 changes: 2 additions & 1 deletion src/tui-harness/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* AgentCore CLI recognizes as valid projects, without the overhead of
* running the full create wizard or npm/uv installs.
*/
import { DEFAULT_PYTHON_VERSION } from '../schema';
import { mkdir, mkdtemp, rm, writeFile } from 'fs/promises';
import { tmpdir } from 'os';
import { join } from 'path';
Expand Down Expand Up @@ -103,7 +104,7 @@ export async function createMinimalProjectDir(
build: 'CodeZip',
entrypoint: 'main.py:handler',
codeLocation: 'app/TestAgent',
runtimeVersion: 'PYTHON_3_13',
runtimeVersion: DEFAULT_PYTHON_VERSION,
});

// Create the agent code directory so the CLI does not complain.
Expand Down
Loading