fix(cli): default new agents to PYTHON_3_13 instead of PYTHON_3_14 (#907)#35
Draft
aidandaly24 wants to merge 2 commits into
Draft
fix(cli): default new agents to PYTHON_3_13 instead of PYTHON_3_14 (#907)#35aidandaly24 wants to merge 2 commits into
aidandaly24 wants to merge 2 commits into
Conversation
PYTHON_3_14 is not yet GA in every region (e.g. eu-central-1), so new agents created with the default runtime wrote an unsupported version into agentcore.json. validate passed but the first CloudFormation deploy was rejected by AWS::EarlyValidation::PropertyValidation, leaving the stack stuck in REVIEW_IN_PROGRESS with no recovery path. Lower DEFAULT_PYTHON_VERSION to PYTHON_3_13 and reorder the TUI PYTHON_VERSION_OPTIONS picker so 3.13 is the recommended first choice; 3.14 stays selectable (and is labeled as not yet available in all regions) for users in supported regions.
Coverage Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs aws#907
Issues
PYTHON_3_14runtime accepted by CLI but rejected by CloudFormation aws/agentcore-cli#907 — A new user who runsagentcore init/add agent/deployin any region where PYTHON_3_14 is not yet GA (the reporter used eu-central-1) gets the unsupported runtime written into agentcore.json by default.agentcore validatepasses, but CloudFormation rejects it via AWS::EarlyValidation::PropertyValidation, leaving the stack stuck in REVIEW_IN_PROGRESS. The CLI then hard-blocks every subsequent deploy with no recovery path, so the user must manuallyaws cloudformation delete-stackto proceed.Root cause
verified: DEFAULT_PYTHON_VERSION='PYTHON_3_14' at constants.ts:153 (git blame PR aws#837/b139c0507), consumed at schema-mapper.ts:129 + packaging fallbacks; picker 'Latest' at mcp/types.ts:428; no region guard in CLI/validate; REVIEW_IN_PROGRESS blocks at stack-status.ts:16 / preflight.ts:288. CDK passthrough at AgentCoreRuntime.ts:243 (no validation). Could not personally confirm service-side regional availability of PYTHON_3_14 (a service fact, not in code).
The fix
Primary (resolves the reported scenario): lower the default to a universally-available runtime — set DEFAULT_PYTHON_VERSION = 'PYTHON_3_13' in src/schema/constants.ts:153, and stop listing PYTHON_3_14 first/'Latest' in the picker at src/cli/tui/screens/mcp/types.ts:428 (keep it selectable in PythonRuntimeSchema:149 for opt-in in supported regions). This is exactly what the OPEN canonical fix PR aws#1172 does. For the MCP/Lambda compute path, apply the matching change to the CDK construct's DEFAULT_MCP_PYTHON_VERSION (mcp-utils.ts:5, currently 'PYTHON_3_14') and the lambda.Runtime fallback in McpLambdaCompute.ts:81, then ship a CDK release the vended caret range picks up. Optional hardening (CLOSED PR aws#1157's approach): special-case REVIEW_IN_PROGRESS in stack-status.ts to detect a never-deployed stuck stack and offer delete-and-retry (a --recover flag), plus surface the CFN early-validation error with a concrete hint. Design decision: prefer a safer default plus clearer error surfacing over a brittle, service-driven region-vs-runtime compatibility table.
Files touched: CLI (primary): src/schema/constants.ts:153 (DEFAULT_PYTHON_VERSION), src/cli/tui/screens/mcp/types.ts:428 (PYTHON_VERSION_OPTIONS ordering/'Latest'); optional src/cli/cloudformation/stack-status.ts:16,68-74 and src/cli/operations/deploy/preflight.ts:288 (REVIEW_IN_PROGRESS recovery). CDK construct @aws/agentcore-cdk (for MCP path only): src/cdk/constructs/components/mcp/mcp-utils.ts:5 (DEFAULT_MCP_PYTHON_VERSION) and McpLambdaCompute.ts:81 fallback. Note: schema-mapper.ts:129 and lib/packaging/{python,index}.ts consume the constant and need no change once the default is fixed.
Validation evidence
The fix was verified by reproducing the original symptom and re-running after the change:
Test suite: green.
Staged on the fork as a draft for human review. Promote to aws/agentcore-cli after vetting.