Skip to content

AgentEngineSandboxCodeExecutor uses wrong JSON field names for stdout/stderr #3690

Closed

Description

@guanerdan

Description

The AgentEngineSandboxCodeExecutor class has two field name mismatches that cause it to fail silently:

Bug 1: stdout/stderr field names

Location: agent_engine_sandbox_code_executor.py lines 138-140

Code expects API returns
stdout msg_out
stderr msg_err

Result: CodeExecutionResult.stdout and stderr are always empty.

Bug 2: Input file field names

Location: agent_engine_sandbox_code_executor.py lines 113-119

Code sends API expects
contents content
mimeType mime_type

Result: Input files are not readable in the sandbox, causing errors like pandas.errors.EmptyDataError: No columns to parse from file.

Environment

  • google-adk version: 1.19.0
  • Python version: 3.13

Activity

  1. added
    agent engine[Component] This issue is related to Vertex AI Agent Engine
    on Nov 24, 2025
  2. added theissue type on Nov 24, 2025
  3. adk-bot commented on Dec 3, 2025

    @adk-bot
    Collaborator

    Notification: The author has updated the issue description. Maintainers, please review.

  4. adk-bot commented on Dec 19, 2025

    @adk-bot
    Collaborator

    This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.

  5. added
    stale[Status] Issues which have been marked inactive since there is no user response
    on Dec 19, 2025
  6. guanerdan commented on Dec 22, 2025

    @guanerdan
    Author

    still waiting....

  7. removed
    stale[Status] Issues which have been marked inactive since there is no user response
    on Dec 23, 2025
  8. llalitkumarrr commented on Jan 7, 2026

    @llalitkumarrr
    Collaborator

    Hello @guanerdan ,

    Apologies for the delayed response. To help us investigate this further, could you please provide more details? Specifically, we would appreciate the full error message, steps to reproduce the issue, and a minimal code example. This will allow us to assist you more effectively.

  9. adk-bot commented on Jan 15, 2026

    @adk-bot
    Collaborator

    This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.

  10. added
    stale[Status] Issues which have been marked inactive since there is no user response
    request clarification[Status] The maintainer need clarification or more information from the author
    on Jan 15, 2026
  11. added
    good first issue[Community] This issue is good for newcomers to participate
    and removed
    stale[Status] Issues which have been marked inactive since there is no user response
    on Jan 21, 2026
  12. adk-bot commented on Jan 22, 2026

    @adk-bot
    Collaborator

    This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.

  13. 5 remaining items

  14. jbets4 commented on Feb 17, 2026

    @jbets4

    Attached above is a fix for this issue: #4516

  15. llalitkumarrr commented on Feb 24, 2026

    @llalitkumarrr
    Collaborator

    Thank you @Sudhendra and @jbets4 for your contribution your PR is being reviewed and we appreciate your patience.

  16. added
    needs review[Status] The PR/issue is awaiting review from the maintainer
    on Apr 22, 2026
  17. Number531 commented on Apr 24, 2026

    @Number531

    Confirming this issue still reproduces on ADK v1.27.2 and through v1.31.1 — affected code paths unchanged from v1.19.0 as described in the original report.

    Additional data points from production deployment (April 2026):

    • Bug 2 (contents vs content): confirmed via live testing. input_files arrive in the sandbox with declared filename but zero bytes; pandas.read_csv raises EmptyDataError, typically surfaced to callers as a vague "file is empty" error rather than a clear field-name mismatch. One-word fix at agent_engine_sandbox_code_executor.py:147 (change 'contents' → 'content') resolves this completely.

    • Bug 1 (stdout/stderr via msg_out/msg_err): also confirmed. Our patched reader extracts:

      json_output_data = json.loads(output.data.decode("utf-8"))
      stdout = json_output_data.get("msg_out", "")
      stderr = json_output_data.get("msg_err", "")
    • Open question on mimeType vs mime_type: in our deployment, sending mimeType (camelCase, matching current ADK behavior) has not produced observable failures — chart files are returned correctly in output_files. Either the Vertex SDK is field-name-normalizing transparently, or this mismatch only matters for specific mime-type-sensitive code paths we haven't exercised. Has anyone hit a concrete failure traceable to the mimeType/mime_type key specifically?

    Reference patch: utils/sandbox_executor_patched.py — subclass of AgentEngineSandboxCodeExecutor applying both fixes inline. In continuous production use since April 2026; removes all observed failure modes from this issue.

    Would be glad to submit a PR with these fixes (both are narrow, well-tested). Let me know if that's useful.

  18. removed
    request clarification[Status] The maintainer need clarification or more information from the author
    on May 12, 2026
  19. removed their assignment
    on May 12, 2026
  20. mahesh-github commented on May 28, 2026

    @mahesh-github

    Can I check on this issue

  21. added 3 commits that reference this issue on Jun 16, 2026
    55975f3
    4a4a09e
    20b6918
  22. added a commit that references this issue on Jun 17, 2026
    2b7e08a
  23. added a commit that references this issue on Aug 11, 2026
    c628d04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

agent engine[Component] This issue is related to Vertex AI Agent Enginegood first issue[Community] This issue is good for newcomers to participateneeds review[Status] The PR/issue is awaiting review from the maintainer

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions