Skip to content

fix(core): preserve subagent multimodal tool response parts - #29621

Draft
shivangsharma01 wants to merge 1 commit into
google-gemini:mainfrom
shivangsharma01:fix/subagent-multimodal-tool-results
Draft

shivangsharma01 wants to merge 1 commit into
google-gemini:mainfrom
shivangsharma01:fix/subagent-multimodal-tool-results

Conversation

@shivangsharma01

Copy link
Copy Markdown

Summary

Preserve all scheduler response parts when a local subagent feeds tool results back to the model. Image data emitted as a sibling of a function response was previously discarded.

Details

Track arrays of response parts by call ID and append each complete result in the model's original function-call order. Keep truncation, unauthorized-call errors, soft rejection, and missing-result checks intact.

The regression test executes two image-returning tool calls, reverses their scheduler completion order, and verifies that the next model request contains both function responses and both image payloads. It fails on the base commit because the image parts are absent.

This draft addresses the localized sibling-part loss reported in #29574. The issue is not yet labeled help wanted; maintainer triage is needed before review. The reported live API 400 error has not been reproduced.

Related Issues

Related to #29574.

How to Validate

npm exec --workspace @google/gemini-cli-core -- vitest run src/agents/local-executor.test.ts src/utils/tool-utils.test.ts
npm run preflight

Focused validation: 86 tests passed. Full preflight on base c6bccb7ec passed build, all lint checks, and typechecks. Test results: CLI 7,196 passed (4 skipped); core 8,157 passed (54 skipped), with one failure in the unchanged macOS PTY cleanup test; the other completed workspaces passed. Preflight exited 1.

The failing test is ShellExecutionService > Orphan PTY slave FD cleanup > synchronously closes the matching slave fd when platform is darwin: expected descriptor 12, received undefined. Rerunning the shell-execution suite reproduces it (83 passed, 1 failed). Neither its source nor test file differs from upstream.

The branch was subsequently rebased onto fb972b2f8; the full build and repository typechecks passed again, as did ESLint and Prettier for the changed files. The executor, output-truncation, and chat-recording suites passed all 146 tests.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed) — existing behavior restored; no new configuration or command.
  • Added/updated tests (if needed)
  • Noted breaking changes (if any) — none.
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@github-actions github-actions Bot added the size/m A medium sized PR label Oct 3, 2026
@google-cla

google-cla Bot commented Oct 3, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

📊 PR Size: size/M

  • Lines changed: 122
  • Additions: +98
  • Deletions: -24
  • Files changed: 2

@gemini-cli gemini-cli Bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Oct 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality size/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant