aws / aws/agentcore-cli

'charmap' codec can't encode character '\U0001f680' in position 4: character maps to <undefined>

Open
#2,010 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
283
Forks
95
Avg merge
1d 2h
Merged PRs (30d)
183

Description

### Description

Running the bare AgentCore getting-started demo produces a Unicode error:

> 'charmap' codec can't encode character '\U0001f680' in position 4: character maps to

### Steps to Reproduce

Exactly following [Get started with the AgentCore CLI](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-get-started-cli.html):

1. `npm install -g @aws/agentcore`
2. `agentcore create --name MyAgent --framework Strands --protocol HTTP --model-provider Bedrock --memory none`
3. In `MyAgent/model/load.py`, change the model:
> `return BedrockModel(model_id="global.amazon.nova-2-lite-v1:0")`
4. `cd MyAgent`
5. `agentcore dev`
6. Enter a question; e.g. "What are the highlights of the uv package manager for Python?"

### Expected Behavior

The model returns a response with no error.

### Actual Behavior

> The **uv** package manager for Python is an extremely fast, all-in-one tool that simplifies Python development by replacing multiple tools with a single, high-performance solution. Here are the key highlights of **uv**:
>
> ### 🚀 \*\*Error: 'charmap' codec can't encode character '\U0001f680' in position 4: character maps to <undefined>

### CLI Version

0.27.0

### Operating System

Windows

### Additional Context

Initial searches indicated this is related to Python. In any case, in an enterprise framework the first-steps demo should run without issue, across platforms.

From experience, I would guess that one or more layer is making assumptions about the system charset rather than being explicit about which charset is needed.

Looking at the console stack trace, the error seems to originate in: `MyAgent\\app\\MyAgent\\.venv\\Lib\\site-packages\\bedrock_agentcore\\runtime\\app.py:_sync_stream_with_error_handling:945`

Contributor guide

Open the contributing guide

Research direction

Reproduce the Windows failure with the documented AgentCore CLI commands and inspect MyAgent/.venv/Lib/site-packages/bedrock_agentcore/runtime/app.py at _sync_stream_with_error_handling around line 945. Trace how streamed response text is written or encoded, then verify that the getting-started demo handles the 🚀 character without a Unicode error on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
backend, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.