Set default value for ToolAnnotations readOnlyHint#123
Merged
domfarolino merged 2 commits intowebmachinelearning:mainfrom Mar 4, 2026
Merged
Set default value for ToolAnnotations readOnlyHint#123domfarolino merged 2 commits intowebmachinelearning:mainfrom
domfarolino merged 2 commits intowebmachinelearning:mainfrom
Conversation
Contributor
Author
|
@domfarolino Please review |
domfarolino
reviewed
Mar 3, 2026
Collaborator
domfarolino
left a comment
There was a problem hiding this comment.
Could you update this step (https://webmachinelearning.github.io/webmcp/#ref-for-dom-toolannotations-readonlyhint) to not perform the existence check anymore?
Contributor
Author
Done |
domfarolino
approved these changes
Mar 4, 2026
github-actions bot
added a commit
that referenced
this pull request
Mar 4, 2026
SHA: 3da78ad Reason: push, by domfarolino Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
beckysiegel
pushed a commit
to chromium/chromium
that referenced
this pull request
Mar 4, 2026
This CL fixes a crash in WebMCP's `registerTool()` method, whereby if the optional `annotations` member was present, we assumed its also-optional `readOnlyHint` member was always available, and grabbed it without checking `hasReadOnlyHint()` first, which was necessary since `readOnlyHint` is an optional member. This CL gives `readOnlyHint` a default value of `false` so that it is always present, and CHECK()s that `hasReadOnlyHint()` is true before accessing. See webmachinelearning/webmcp#123. R=bengr Bug: N/A Change-Id: Ie2761008089186aa30abe571c4834df500a711bc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7614599 Reviewed-by: Ben Greenstein <bengr@chromium.org> Commit-Queue: Dominic Farolino <dom@chromium.org> Cr-Commit-Position: refs/heads/main@{#1594198}
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.
This PR sets a default value of false for ToolAnnotations readOnlyHint since MCP already defined a default value of
falseforreadOnlyHint.This PR also uses

dfn-type=dict-member dfn-for=ToolAnnotationsto get this nice automatic formatting: