Skip to content

fix(skills): preserve sibling parts when loading binary resources - #1589

Open
quifox wants to merge 1 commit into
google:mainfrom
quifox:fix/skill-resource-mixed-parts
Open

quifox wants to merge 1 commit into
google:mainfrom
quifox:fix/skill-resource-mixed-parts

Conversation

@quifox

@quifox quifox commented Oct 1, 2026

Copy link
Copy Markdown

Description of Change

Problem: When load_skill_resource expands a binary function response in the final request content, its request processor drops every other part from that content. For example, a binary resource response and a sibling tool response merged into one content become only the binary resource response and its inline data.

Solution: Preserve parts that are not binary responses from this tool. Keep the existing binary expansion in place and retain the original ordering of text, sibling responses, and existing inline data. Add regression coverage for mixed parts, repeated processing, and content with no binary resource response.

Testing Plan

Unit Tests:

  • I have added unit tests for my change.
  • New and existing core unit tests pass with my changes.

Java 17, with Google Java formatting enabled:

mvn -B -ntp -pl core -Dfmt.skip=false -Dtest=LoadSkillResourceMixedPartsRegressionTest,LoadSkillResourceToolTest -Dsurefire.failIfNoSpecifiedTests=false test
mvn -B -ntp -pl core -Dfmt.skip=false test

The focused suite passed 15 tests in each of the default-test and basic executions. Full core completed with 2,017 tests, 0 failures, 0 errors, and 24 skipped in each of those two executions. The additional configured Surefire executions also completed successfully. The two main executions run the same suite; their counts are not added together as distinct tests.

Manual End-to-End (E2E) Tests: Not run against a live model provider. The unit tests exercise the request processor directly with a mixed content payload and verify preserved order, function-response IDs, binary bytes, MIME type, and stable repeated processing.

Checklist

  • I have read CONTRIBUTING.md.
  • My pull request contains a single commit.
  • I have performed a self-review of my code.
  • I have added tests that prove the fix is effective.
  • New and existing core unit tests pass with my changes.
  • I have manually tested my changes end-to-end.

No new dependencies or public APIs are introduced.

@google-cla

google-cla Bot commented Oct 1, 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant