Skip to content

Allow executeTool() to return null. - #336

Closed
markafoltz wants to merge 2 commits into
mainfrom
fix-execute-tool
Closed

markafoltz wants to merge 2 commits into
mainfrom
fix-execute-tool

Conversation

@markafoltz

@markafoltz markafoltz commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

This happens when executeTool() is called on a missing tool, or a result value cannot be stringified.


Preview | Diff

@beaufortfrancois

Copy link
Copy Markdown
Collaborator

My understanding is that your PR changes change alone don't make null reachable: every path in the tool execute steps / imperative execute steps that yields null also passes success = false, so executeTool() returned promise always rejects with UnknownError (missing tool, serialization failure, etc.).

@markafoltz

Copy link
Copy Markdown
Collaborator Author

I see that now, but:

@beaufortfrancois

Copy link
Copy Markdown
Collaborator
  • Blink IDL returns Promise<DOMString?>, is there a reason for the discrepancy?

Yep. ? is because the declarative API returns null on cross-document navigation.

@domfarolino

Copy link
Copy Markdown
Collaborator

If that's the only reason, and the spec doesn't fully support declarative WebMCP and its cross-origin implications, then it sounds like maybe we don't need this (until we fully spec declarative)?

@markafoltz

Copy link
Copy Markdown
Collaborator Author

I think we can drop this until we need to accommodate the declarative API; a comment in the IDL might be useful tho.

The other changes are superseded by #339.

@markafoltz markafoltz closed this Oct 7, 2026
@markafoltz
markafoltz deleted the fix-execute-tool branch October 7, 2026 19:11
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.

3 participants