agentcore deploy fails with 'Response object is too long' when config bundle components exceed 4 KB

オープン
#2,518 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@notgitika がすでに取り組んでいます。

2026年10月19日 から。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
aws, typescript
領域
cli, cloud

調査の方向性

Start by tracing agentcore deploy and agentcore validate, then inspect how the @aws/agentcore-cdk construct handles ConfigBundleMyConfig/Components through Custom::AWSCDKCfnJson. Compare that path with the update-configuration-bundle API call mentioned in the issue. Done means large components can deploy and create a branch version, or validation reports a size limit before CloudFormation runs.

索引モデルが issue の本文から書いたものです。

説明

Description

agentcore deploy fails when a config bundle's components JSON is larger than ~4 KB. A realistic system prompt in configBundles[].components[].configuration.systemPrompt easily exceeds this.

The @aws/agentcore-cdk construct (0.1.0-alpha.54) resolves the components map, which includes {{runtime:<name>}} placeholders, through a Custom::AWSCDKCfnJson custom resource. CloudFormation limits a custom resource response to 4096 bytes. When the components are bigger than that, the custom resource fails and the stack rolls back.

The CLI also has no other way to publish a larger configuration. agentcore config-bundle only offers versions, diff and create-branch. The only workaround is calling aws bedrock-agentcore-control update-configuration-bundle directly, outside the project, which makes the deployed bundle drift from agentcore.json.

Steps to Reproduce
  1. Create a project with a CodeZip runtime and a config bundle targeting it:
    "configBundles": [
      {
        "name": "myConfig",
        "type": "ConfigurationBundle",
        "components": {
          "{{runtime:myagent}}": {
            "configuration": {
              "systemPrompt": "<any string longer than ~4,000 characters>"
            }
          }
        },
        "branchName": "mainline",
        "commitMessage": "Long prompt"
      }
    ]
    
  2. agentcore validate: passes.
  3. agentcore deploy --target dev --diff: shows the expected change to Custom::AWSCDKCfnJson .../ConfigBundleMyConfig/Components/Resource.
  4. agentcore deploy --target dev -y
Expected Behavior

The bundle deploys and a new version is created on the branch. The configuration bundle API accepts this payload: the same ~9.3 KB components map works through aws bedrock-agentcore-control update-configuration-bundle.

If there is a size limit, agentcore validate (or the deploy preflight) should report it before CloudFormation runs.

Actual Behavior
CDK deploy failed: ❌  AgentCore-<project>-dev failed: DeploymentError: Resource updates failed:
 └─ AgentCore-<project>-dev
     └─ Application
         └─ ConfigBundleMyConfig
             └─ Components
                 └─ Resource
                     └─ Default  (Custom::AWSCDKCfnJson ApplicationConfigBundleMyConfigComponents...)
                        🛑 Response object is too long.
                        Source Location: ...aws-cdk-lib, new AgentCoreApplication in @aws/agentcore-cdk...

The stack ends in UPDATE_ROLLBACK_COMPLETE and the bundle keeps its previous version.

CLI Version

0.31.1

Operating System

macOS

Additional Context
  • @aws/agentcore-cdk 0.1.0-alpha.54, Node 24.12.0, region eu-central-1.
  • In our case the components JSON was ~9.3 KB (a ~8.7 KB system prompt plus the runtime ARN key).
  • Possible fixes:
    • Keep the token-keyed map out of the custom resource response. CloudFormation limits the response, not the request, so a custom resource that creates or updates the bundle itself, without echoing the components back, avoids the limit.
    • Or support a file reference (e.g. systemPromptFile) that the CLI pushes through the configuration-bundle API, or publish via config-bundle subcommands.
  • At minimum, agentcore validate should warn when the serialized components exceed the limit.
主要言語
TypeScript
スター
339
フォーク
129
平均マージ
19時間 21分
マージ済み PR(30日)
125

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/agentcore-cli のほかの issue

aws/agentcore-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。