Support allowedPorts (session endpoints) on runtimes

未關閉
#2,811 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
35/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
aws, typescript
領域
cli, cloud

研究方向

Start by reading RuntimeSpecSchema in the @aws/agentcore CLI and trace how agentcore deploy creates and updates runtimes. Then check the AgentCoreRuntime construct in @aws/agentcore-cdk and the runtime and invoke commands; CloudFormation support for AllowedPorts is a stated dependency. Done means the spec accepts the documented port rules, deploys preserve the setting, and the relevant commands can print a session endpoint URL.

由索引模型根據 Issue 內容生成。

描述

Description

A runtime's agentcore.json spec has no field for allowedPorts, so a project deployed with agentcore deploy cannot enable session endpoints. The gap is also in CloudFormation: AWS::BedrockAgentCore::Runtime has no AllowedPorts property (checked with aws cloudformation describe-type --type RESOURCE --type-name AWS::BedrockAgentCore::Runtime in ap-southeast-1). Today the only way to get the setting is to call CreateAgentRuntime or UpdateAgentRuntime directly, outside the project.

Patching the runtime after agentcore deploy does not hold up. UpdateAgentRuntime replaces the whole configuration, so the next deploy is likely to drop allowedPorts again, and the session endpoint stops working with no error.

Our use case is an agent that serves a REST API with server-sent events. We want to reach it through each session's endpoint, because InvokeAgentRuntime turns any non-2xx answer into 424 RuntimeClientError and drops the response's headers. We have worked around this by wrapping our API inside /invocations. We would rather use session endpoints, which is what they are for.

Acceptance Criteria
  • A runtime in agentcore.json accepts allowedPorts with the API's rules: 1–5 entries, each a port or a portRange, within 8000–12000, and none of them reserved.
  • agentcore deploy creates and updates the runtime with them, and a later deploy keeps them.
  • The AgentCoreRuntime construct in @aws/agentcore-cdk exposes them (this depends on CloudFormation supporting AllowedPorts on AWS::BedrockAgentCore::Runtime).
  • agentcore invoke, or the runtime commands, can print a session's sessionEndpointUrl.
Additional Context
  • CLI @aws/agentcore 1.0.3 and @aws/agentcore-cdk 1.0.3: RuntimeSpecSchema has no allowedPorts field.
  • On a runtime created through the API with allowedPorts: [{ port: 8080 }], the session endpoint passes every method, path, status code, header and SSE stream as documented, with about the same latency as InvokeAgentRuntime.
主要語言
TypeScript
星號
339
分支
129
平均合併
19 小時 21 分鐘
30 天內合併 PR
125

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

aws/agentcore-cli 的其他 Issue

查看 aws/agentcore-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。