aws / aws/agentcore-cli

APPLICATION_LOGS response_payload always null for non-streaming Strands agents

Offen
#889 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
TypeScript
Sterne
283
Forks
95
Ø Merge
1 T. 2 Std.
Gemergte PRs (30 T.)
183

Beschreibung

### Description

## Problem

`response_payload` in APPLICATION_LOGS is always `null`, even though `request_payload` works fine.

## Setup

- Strands Agent deployed via `agentcore deploy`
- Non-streaming: `@app.entrypoint def invoke(...)` returns plain dict
- `bedrock-agentcore 1.6.3`, `strands-agents 1.35.0`, region `us-east-1`
- APPLICATION_LOGS delivery: CWL, `response_payload` is in `recordFields`

## What I see

```json
{
"request_payload": {"message": "hi", "user_type": "tourist"},
"response_payload": null
}
```

## What I tried

Changed return format to {"result": "..."} → still null
Toggled recordFields → still null
IAM permissions correct, Tracing enabled

## Question
Is response_payload only populated for SSE streaming responses (not plain JSON return)?

Or is there a config I'm missing?

### Steps to Reproduce

1. Deploy a Strands agent with `agentcore deploy` — use non-streaming entrypoint:
```python
@app.entrypoint
def invoke(payload, context):
agent = Agent(model=..., tools=[...])
result = agent(payload.get("message"))
return {"result": str(result)}
```
2.Enable APPLICATION_LOGS delivery to CloudWatch (via console or put-delivery-source)
3.Invoke the deployed agent via Agent Sandbox or invoke_agent_runtime API
4.Open CloudWatch → log group /aws/vendedlogs/bedrock-agentcore/runtime/APPLICATION_LOGS/
5.Observe: response_payload is null while request_payload is populated

### Expected Behavior

`response_payload` in APPLICATION_LOGS should contain the agent's return dict, e.g. `{"result": "..."}`.

### Actual Behavior

`response_payload` is always `null`, even though `request_payload` is populated and the agent responds correctly to clients.

### CLI Version

0.8.2

### Operating System

Windows

### Additional Context

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, das Problem mit dem nicht streamenden Python-Beispiel @app.entrypoint und der dokumentierten Einrichtung von agentcore deploy und APPLICATION_LOGS zu reproduzieren. Verfolge, wie die CLI- oder AgentCore-Integration request_payload und response_payload verarbeitet, und überprüfe anschließend, ob das Response-Dictionary in den CloudWatch-Logs erscheint, oder ermittle die fehlende Konfiguration beziehungsweise das nicht unterstützte Verhalten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, python, typescript
Bereich
cloud, observability
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.