Repository navigation
fix(sdk): send only name to get_screen - #382
Open
saariuslystoned wants to merge 2 commits into
Open
saariuslystoned wants to merge 2 commits into
saariuslystoned wants to merge 2 commits into
Conversation
The live get_screen tool takes only `name` and rejects any extra field
("Request contains an invalid argument"). The manifest re-capture in google-labs-code#372
recorded that, but Project.getScreen, Screen.getHtmlUrl and
Screen.getImageUrl kept sending projectId and screenId, so they fail
against the live server whenever no cached URL is available.
- domain-map: the three get_screen bindings send only the computed
`name`. Project.getScreen keeps its screenId parameter through a new
`templateOnly` param flag (in the signature and template, never sent).
- codegen: validateArgs fails generation when a binding sends an arg the
tool's inputSchema does not declare, so this kind of schema drift is
caught at generation time.
- Regenerate project.ts / screen.ts and the lock.
- Apply the same fix to the handwritten callers: the downloadAssets
fallback, refresh-response-fixtures.ts and the README example.
- Document templateOnly in the domain-design skill and check:skills.
Fixes google-labs-code#381
Bring the PR branch current with upstream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
☁️ Friendly check-in: this branch is current with the base branch, and CI is waiting on maintainer approval to run workflows from a fork. Could a maintainer approve the run, or let me know if this change is not wanted so I can close it? Thanks! |
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.
Fixes #381.
Problem
The live
get_screentool takes onlyname. The manifest re-capture in #372 recorded this (get_screen'sinputSchemawent from{name, projectId, screenId}to{name}), but the three bindings that call it kept sendingprojectIdandscreenId. Codegen validates only output projections, so nothing flagged the drift. The server rejects the extra fields:get_screenarguments{ name }{ name, projectId, screenId }isError: true, "Request contains an invalid argument."{ projectId, screenId }{ name, projectId: "projects/…", screenId }Checked 2026-10-22 against
https://stitch.googleapis.com/mcpwith API-key auth.As a result,
Screen.getHtmlUrl()/getImageUrl()(andgetHtml()/getImage()) fail for any screen without cached URLs,Project.getScreen()always fails, anddownloadAssets()skips those screens.Fix
domain-map.json:Screen.getHtmlUrl/getImageUrlsend onlyname(the template already readsthis.projectId/this.screenId).Project.getScreen(screenId)keeps its signature;screenIdis markedtemplateOnly.templateOnlyflag onparamargs. The param stays in the method signature and feedscomputedtemplates, but is not sent.validateArgsfails generation when a binding sends an arg that the tool'sinputSchemadoesn't declare. On the old map it reports:Binding "Project.getScreen": arg "projectId" is not declared in the tool's inputSchema. Available properties: name.project.ts/screen.tsand the lock. Apart from header hashes, the only generated change is the removed fields.get_screencallers: theDownloadAssetsHandlerfallback,scripts/refresh-response-fixtures.ts, and the READMEcallToolexample. Updated the domain-design skill andcheck:skillsfor the new IR field.Tests
sdk.test.ts:getHtmlUrl,getImageUrlandProject.getScreenassert the request is exactly{ name }. These tests fail onmain.download.test.ts: theget_screenfallback sends onlyname.templateOnlyemission,validateArgs, the IR schema, and a fixture binding in the golden codegen suite (snapshot updated).Results with Bun 1.3.1 (all tests mock the client; no live calls):
npm run test: 364 passed (362 onmain)npm run test:scripts: 127 passed (119 onmain)validate:generated,check:skills,typecheck,build,test:smoke,test:coverage,check:bundle,check:consumer-types,check:examplesandpublish:readinessall pass.format:checkflags onlybridge-0.4.0-premortem.test.tsandschema-repair.test.ts. This PR doesn't touch them, and they fail the same way onmain.🤖 Generated with Claude Code
Merged upstream
mainatf6aa86cde1(SDK client surface header). No conflicts; that change does not touch this PR's files.Known gaps: the recorded tests mock the client and make no live Stitch calls.
format:checkstill fails onbridge-0.4.0-premortem.test.tsandschema-repair.test.ts, the same as onmain. GitHub Actions CI is waiting on maintainer approval.☁️