ContainerCodeExecutor reports silent nonzero exits as successful execution
维护者通常 3 天内回复
评估
这个 Issue 还没有评估数据。
描述
ContainerCodeExecutor returns exit_code=7 with empty stderr for a program such as import os; os._exit(7). Result conversion consequently emits OUTCOME_OK, and the code-execution flow resets its error retry count. Only timeout status 124 currently receives a synthesized diagnostic.
Expected: a nonzero process exit produces an execution error even without stderr, yielding OUTCOME_FAILED and consuming an error retry. Actual: silent nonzero exits appear successful. UnsafeLocalCodeExecutor already reports Code execution exited with status 7. for this input.
Offline reproduction
No Docker daemon, model, or credentials are required. Run this script with the ADK dependencies installed and PYTHONPATH=<checkout>/src:
from unittest.mock import MagicMock, patch
from google.adk.code_executors.container_code_executor import ContainerCodeExecutor
from google.adk.code_executors.code_execution_utils import CodeExecutionInput, CodeExecutionUtils
with patch('google.adk.code_executors.container_code_executor.docker') as docker:
container = docker.from_env.return_value.containers.run.return_value
container.exec_run.return_value = MagicMock(exit_code=0, output=(b'', b''))
container.get_archive.return_value = ([b''], {})
with ContainerCodeExecutor(image='offline-test') as executor:
container.exec_run.side_effect = lambda cmd, **kw: MagicMock(
exit_code=7 if cmd[0] == 'python3' else 0, output=(b'', b''))
result = executor.execute_code(None, CodeExecutionInput(code='import os; os._exit(7)'))
part = CodeExecutionUtils.build_code_execution_result_part(result)
print(result.exit_code, repr(result.stderr), part.code_execution_result.outcome.value)
Before fix: 7 '' OUTCOME_OK.
After fix: 7 'Code execution exited with status 7.' OUTCOME_FAILED.
Environment: macOS arm64, Python 3.11.17, ADK main (2.14.1). Docker transport is mocked; the real executor, result conversion, and flow are exercised by the regressions. Regression introduction is unknown.
- 主要语言
- Python
- 星标
- 22.3k
- 派生
- 4.4k
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/adk-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
google/adk-python#8360 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
google/adk-python#8359 ·
维护者通常 3 天内回复
-
Can pin to litellm version be changed?可能已有人在做 @llalitkumarrr 于 10 天前认领。 未关闭models
难度 1/5 1 小时以内 新手友好度 65/100
google/adk-python#8129 · 2 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
OpenAPI tools ignore operation- and path-level server overrides可能已有人在做 @sanketpatil06 于 14 天前认领。 未关闭tools
难度 2/5 1-3 小时 新手友好度 75/100
google/adk-python#8064 · 4 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
Two docstrings in openapi_tool document parameters the signatures do not accept可能已有人在做 @surajksharma07 于 17 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
google/adk-python#8024 · 1 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
查看 google/adk-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
vllm-project/vllm#70030 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
TigreGotico/tugaphone#408 ·
维护者通常 1 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 74/100
gke-labs/kube-agents#7308 ·
维护者通常 1 天内回复
-
t: bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 3 天内回复
-
chore
难度 1/5 1-3 小时 新手友好度 88/100
lugassawan/swe-workbench#841 ·