Support allowedPorts (session endpoints) on runtimes

Aperta
#2,811 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
aws, typescript
Ambito
cli, cloud

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
TypeScript
Stelle
339
Fork
129
Merge medio
19h 21m
PR unite (30g)
125

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aws/agentcore-cli

Tutte le issue di aws/agentcore-cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.