Repository navigation
fix(rql): keep image blocks next to structured content; screenshot image tests in both data layers - #1213
Merged
Conversation
…age tests - RqlToolBinding.Result: a ResponseCallTool with StructuredContent kept only one text block, so an image/audio/resource block returned with data never reached the agent. Only the text blocks are replaced by the rendered RQL text now. - Tests: RunToolRqlResultTests covers an image next to structured content and an image alone through RunTool with the RQL binding; ScreenshotImageResultTests (Graphics) calls screenshot-camera and screenshot-isolated through the tool manager in the Json and Rql layers and checks the image/png content block. - screenshot-isolated says it returns the PNG image, not "a base64-encoded PNG". - script-execute (DEV-314): already a hidden alias (Visible = false, left out of tools/list by the server); the test now also checks the listed Visible flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…olated wording Recorded in-process by ChainRecordTests on 2022.3.62f3, 6000.0.85f1, 6000.3.27f1 and 6000.6.7f1 (prepared with commands/extensions.py, canonicalized with chain_fixture.py); against the committed fixtures the only tool change is screenshot-isolated's description. Also: the RQL image test checks the rendered text instead of parsing it, and the Unity-generated .meta of ScreenshotImageResultTests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the new tests - RunToolRqlResultTests: one RqlTool/Call helper replaces three copies of the RunTool setup; the test PNG is ScreenshotSavePathTests.TinyPng; ImageWithData builds on ImageOnly. - ToolResults.PngImage: the one image/png block of a response, used by both image tests. - ScreenshotImageResultTests calls through BaseTest.RunTool with JSON arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- RqlToolBinding.Result drops only McpPlugin's JSON copy of the structured content (text/json, or text equal to it); a caption or other text the tool returned still reaches the agent, as in the Json layer. The test expects the caption and checks the rendered values. - ScreenshotImageResultTests switches the layer through RqlToolBinding.Apply, which prebuilds the RQL signatures on the main thread first. - CSharpExecResultTests compares csharp-exec's listed Visible flag with IsToolVisible instead of assuming the project config shows it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A. RQL layer dropped non-text blocks next to structured data.
RqlToolBinding.Resultreplaced the wholeContentof aResponseCallToolthat hasStructuredContentwith one text block, so an image, audio or resource block returned with data never reached the agent. Now only McpPlugin's JSON copy of the data (thetext/jsonblock, or text equal to it) is replaced by the rendered RQL text. Every other block (image, audio, resource, a caption) is kept, as it is in the Json layer.ResponseCallTool.ImagewithoutStructuredContent, which passes through unchanged in both layers. So this closes a latent case rather than a live screenshot bug.RunToolRqlResultTestsruns an image + structured content result and an image-only result throughRunToolwith the RQL binding, which exercisesProcessInvokeResult.B. Screenshot tools return an MCP image block in both data layers. New
ScreenshotImageResultTests([RequiresGraphicsDevice], CI Graphics leg) callsscreenshot-cameraandscreenshot-isolatedthrough the plugin tool manager with the Json and the Rql layer. It switches the layer viaRqlToolBinding.Apply, so both layers run in every suite run. It asserts oneimageblock,image/png, PNG data. Nothing is added tobattery.json, because the chain recorder runs with-nographics.C.
screenshot-isolateddescription. "Returns a base64-encoded PNG" becomes "Returns the rendered PNG image", in both the description and the skill body. The other screenshot tools already say they return an image. The chain fixtures of all four Unity versions are re-recorded (see below).D.
script-execute(DEV-314): no code change needed, it is already not in tools/list. Unity already registers it the way Godot does: a hidden alias ([AiTool(Visible = false)],UnityMcpPlugin.RenamedTools) that still answerstools/callwith csharp-exec's code. GameDev-MCP-Server leaves everyVisible = falsetool out oftools/list(itsToolVisibilityTests, server ≥ 9.3.0; the plugin pins 9.6.4). The alias has no SKILL.md and is not inunity-tool-list. Thetests/chain-fixtures/*/tools.jsonlfiles list it because the in-process recorder records the whole registry (RunListTool), hidden tools included (screenshot-camera, script-read and others too). They are not what an MCP client receives.CSharpExecResultTests.OldNameRunsTheSameCodeHiddennow also asserts that the listedVisibleflag (the one the server filters on) is false forscript-execute.Chain fixtures
Re-recorded in-process by
ChainRecordTestson 2022.3.62f3, 6000.0.85f1, 6000.3.27f1 and 6000.6.7f1. Each project was prepared withcommands/extensions.py prepareand the output canonicalized withchain_fixture.py. Against the old fixtures the only tool change is screenshot-isolated's description; the meta line carries the new versions. A final recording on 6000.6.7f1 with the reviewed code diffs identical (exit 0).Verification (local Unity, Windows)
-nographics -toolDataLayer Rql-nographics -toolDataLayer Json-toolDataLayer Rql -testCategory GraphicsScreenshotImageResultTestscases (Json and Rql) pass; 1 failure, see below-toolDataLayer Json -testCategory Graphics-nographics-nographicsFilter:
RunToolRqlResultTests,CSharpExecResultTests,RunToolStructuredContentTests,RqlToolBindingTests,RunToolTests,ScreenshotImageResultTests, plus the Isolated, Camera and SavePathCapture screenshot fixtures for Graphics.ScreenshotSavePathCaptureTests.ScreenshotGameView_NoSavePath_IsUnchanged: "The Game View had not drawn yet". This is the first Game View capture in a local batchmode editor; the next Game View test in the same fixture passes. screenshot-game-view is not touched here. I expect CI's Graphics leg to show whether it happens there too.Not changed (out of scope, for follow-up)
addons/godot_mcp/Editor/Rql/ToolFormat/RqlToolBinding.cshas the same pattern and drops non-text blocks next to structured content.RunTool.ProcessInvokeResult: keep a replaced response's non-text blocks, so no binding has to.🤖 Generated with Claude Code