Skip to content

feat(templates): support agui for python - #2185

Merged
tejaskash merged 5 commits into
aws:refactorfrom
Hweinstock:feat/agui-python-strands-template
Sep 3, 2026
Merged

feat(templates): support agui for python#2185
tejaskash merged 5 commits into
aws:refactorfrom
Hweinstock:feat/agui-python-strands-template

Conversation

@Hweinstock

Copy link
Copy Markdown
Contributor

Problem

AGUI Python templates are not supported.

Solution

  • pull in the assets from mainline.
  • add a new template resolver entry.

Verification

$ agentcore project create --name aguiTest --template agui-python-strands
...
$ agentcore project dev --mode headless --port 8090 &
...
$ curl -N -X POST localhost:8090/invocations \
    -H 'Content-Type: application/json' \
    -d '{"threadId":"t1","runId":"r1","state":{},"messages":[{"id":"m1","role":"user","content":"Reply with exactly: hello from agui"}],"tools":[],"context":[],"forwardedProps":{}}'

data: {"type":"RUN_STARTED","threadId":"t1","runId":"r1"}

data: {"type":"STATE_SNAPSHOT","snapshot":{}}

data: {"type":"MESSAGES_SNAPSHOT","messages":[{"id":"m1","role":"user","content":"Reply with exactly: hello from agui"}]}

data: {"type":"TEXT_MESSAGE_START","messageId":"95e19696-c0cc-4ce2-b296-25148b277efd","role":"assistant"}

data: {"type":"TEXT_MESSAGE_CONTENT","messageId":"95e19696-c0cc-4ce2-b296-25148b277efd","delta":"hello"}

data: {"type":"TEXT_MESSAGE_CONTENT","messageId":"95e19696-c0cc-4ce2-b296-25148b277efd","delta":" from agui"}

data: {"type":"TEXT_MESSAGE_END","messageId":"95e19696-c0cc-4ce2-b296-25148b277efd"}

data: {"type":"MESSAGES_SNAPSHOT","messages":[{"id":"m1","role":"user","content":"Reply with exactly: hello from agui"},{"id":"95e19696-c0cc-4ce2-b296-25148b277efd","role":"assistant","content":"hello from agui"}]}

data: {"type":"STATE_SNAPSHOT","snapshot":{}}

data: {"type":"RUN_FINISHED","threadId":"t1","runId":"r1"}

$ agentcore project deploy
...
$ agentcore project invoke runtime --name agui_python_strands --payload '{"threadId":"t1","runId":"r1","state":{},"messages":[{"id":"m1","role":"user","content":"Reply with exactly: hello from agui"}],"tools":[],"context":[],"forwardedProps":{}}'

data: {"type":"RUN_STARTED","threadId":"t1","runId":"r1"}

data: {"type":"STATE_SNAPSHOT","snapshot":{}}

data: {"type":"MESSAGES_SNAPSHOT","messages":[{"id":"m1","role":"user","content":"Reply with exactly: hello from agui"}]}

data: {"type":"TEXT_MESSAGE_START","messageId":"1e667fda-81ba-42c6-8648-a694f3a3d5b5","role":"assistant"}

data: {"type":"TEXT_MESSAGE_CONTENT","messageId":"1e667fda-81ba-42c6-8648-a694f3a3d5b5","delta":"hello"}

data: {"type":"TEXT_MESSAGE_CONTENT","messageId":"1e667fda-81ba-42c6-8648-a694f3a3d5b5","delta":" from agui"}

data: {"type":"TEXT_MESSAGE_END","messageId":"1e667fda-81ba-42c6-8648-a694f3a3d5b5"}

data: {"type":"MESSAGES_SNAPSHOT","messages":[{"id":"m1","role":"user","content":"Reply with exactly: hello from agui"},{"id":"1e667fda-81ba-42c6-8648-a694f3a3d5b5","role":"assistant","content":"hello from agui"}]}

data: {"type":"STATE_SNAPSHOT","snapshot":{}}

data: {"type":"RUN_FINISHED","threadId":"t1","runId":"r1"}

status=200 content-type=text/event-stream; charset=utf-8 runtime-session-id=356d5ae7-a9c6-408c-94f6-51622588103e mcp-session-id=- mcp-protocol-version=- trace-id=- trace-parent=- trace-state=- baggage=- complete=true bytes=962

had my agent verify the same flow for container, memory/no-memory, and with gemini.

@Hweinstock Hweinstock changed the title Feat/agui python strands template feat(templates): support agui for python Sep 3, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 3, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added claude-security-reviewing Claude Code /security-review in progress agentcore-harness-reviewing AgentCore Harness review in progress labels Sep 3, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 3, 2026
@codecov-commenter

codecov-commenter commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.12%. Comparing base (d403f5d) to head (c22fae4).
⚠️ Report is 3 commits behind head on refactor.

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2185   +/-   ##
=========================================
  Coverage     97.12%   97.12%           
=========================================
  Files           535      535           
  Lines         36844    36889   +45     
=========================================
+ Hits          35783    35828   +45     
  Misses         1061     1061           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Changes requested

Nice, tight scaffold that closely mirrors a2a-python-strands. One concern worth resolving before merge:

ag-ui-strands version pin is incompatible with the shortcut's Python runtime

src/assets/templates/agui-python-strands/pyproject.toml pins ag-ui-strands >= 0.1.7, < 0.2.0, but every release in that range publishes Requires-Python: <3.14,>=3.12. The agui-python-strands shortcut in src/handlers/project/shortcuts.ts sets runtimeVersion: "PYTHON_3_14", which the CodeZip packager in agentcore-l3-cdk-constructs/src/lib/packaging/python.ts forwards to uv pip install --python-version 3.14. pip refuses to resolve this combination outright:

$ pip download 'ag-ui-strands>=0.1.7,<0.2.0' --python-version 3.14 --only-binary :all:
ERROR: Could not find a version that satisfies the requirement ag-ui-strands<0.2.0,>=0.1.7
       (from versions: 0.2.5, 0.3.0)

uv happens to be lenient enough to pull down 0.1.9 today, but relying on that is fragile: the package author has explicitly declared their code doesn't support 3.14, and any tightening of uv's requires-python enforcement will break the default agentcore project deploy for anyone scaffolding this template. (ag-ui-protocol and the container path via python:3.12-slim-trixie are both fine — this is unique to the ag-ui-strands pin.)

Two ways to fix:

  1. Bump the pin to a range that includes 3.14-compatible releases, e.g. ag-ui-strands >= 0.2.5, < 0.4.0 (0.2.5 and 0.3.0 both declare <3.15,>=3.10).
  2. Change the shortcut's runtimeVersion to PYTHON_3_13 so the pin stays inside the package's declared support window.

Everything else looks good: the resolver mirrors the a2a resolver's structure, the AGUI protocol is already wired through dev port/inspector/schema, tests use real temp dirs, and there's no telemetry surface that needs updating for a new template preset.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 3, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 3, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 3, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 3, 2026
@Hweinstock
Hweinstock marked this pull request as ready for review September 3, 2026 17:10
@tejaskash
tejaskash merged commit 79e04bf into aws:refactor Sep 3, 2026
19 of 24 checks passed
@Hweinstock
Hweinstock deleted the feat/agui-python-strands-template branch September 3, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants