googleapis / googleapis/python-aiplatform
ADK creating unicode escape error
- 主要语言
- Python
- 星标
- 905
- 派生
- 465
- 平均合并
- 1 天 13 小时
- 30 天内合并 PR
- 44
描述
#### Environment details
- OS type and version:
- Python version: 3.13.7
- pip version: 25.2
- `google-cloud-aiplatform` version: 1.133.0
#### Steps to reproduce
1. adk create test-agent
2. add requirements.txt file with
google-adk
google-cloud-aiplatform[adk,agent_engines]
3. Run adk deploy agent_engine \
--project="roa-agent" \
--region="us-central1" \
--staging_bucket="gs://roa-agent" \
--display_name="Test Agent" \
test-agent
4. google cloud logs say there's a unicode escape error - which must be being created by the ADK
#### Code example
```python
from google.adk.agents.llm_agent import Agent
root_agent = Agent(
model='gemini-2.5-flash',
name='root_agent',
description='A helpful assistant for user questions.',
instruction='Answer user questions to the best of your knowledge',
)
```
#### Stack trace
```
"Traceback (most recent call last):
File "/usr/local/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/local/lib/python3.12/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
target(sockets=sockets)
File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/uvicorn/supervisors/multiprocess.py", line 64, in target
return self.real_target(sockets)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/uvicorn/server.py", line 67, in run
return asyncio_run(self.serve(sockets=sockets), loop_factory=self.config.get_loop_factory())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/runners.py", line 195, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/uvicorn/server.py", line 71, in serve
await self._serve(sockets)
File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/uvicorn/server.py", line 78, in _serve
config.load()
File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/uvicorn/config.py", line 445, in load
self.loaded_app = self.loaded_app()
^^^^^^^^^^^^^^^^^
File "/code/app/api/app.py", line 60, in create_app
raise e
File "/code/app/api/app.py", line 45, in create_app
utils.load_agent_from_python_spec()
File "/code/app/api/factory/utils.py", line 423, in load_agent_from_python_spec
agent_module = importlib.import_module(ENTRYPOINT_MODULE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 1133, in get_code
File "", line 1063, in source_to_code
File "", line 488, in _call_with_frames_removed
File "/code/test-agent_tmp20260115_093405/agent_engine_app.py", line 10
root_agent = config_agent_utils.from_config("C:\Users\\RoA_agent_parent_folder\test-agent/root_agent.yaml")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape"
timestamp: "2026-01-14T22:45:31.168138Z"
```
贡献指南
调研方向
Reproduce the listed adk create and adk deploy agent_engine commands, then inspect the generated agent_engine_app.py at the failing from_config call and the Windows path shown in the traceback. Done means the generated Python source no longer produces the truncated unicodeescape error and the deployment can import the agent.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- google-cloud, python
- 领域
- ai, cloud
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100