Add CallFunctionMessage and functionResponse.#644
Open
jgindin wants to merge 7 commits intogoogle:mainfrom
Open
Add CallFunctionMessage and functionResponse.#644jgindin wants to merge 7 commits intogoogle:mainfrom
jgindin wants to merge 7 commits intogoogle:mainfrom
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
wrenj
reviewed
Feb 19, 2026
wrenj
reviewed
Feb 19, 2026
wrenj
reviewed
Feb 19, 2026
Enables the server to request a function be invoked on the client. The server can specify whether it wants a response or not. The new `CallFunctionMessage` can be sent at any time from the server, and is not associated with any surface. The function call leverages the existing `FunctionCall` type, but restricts the arguments and return type to scalars (or arrays of scalars). Specifically, neither data binding nor the use of client side function calls is allowed. `CallFunctionMessage`s are not associated with any surface. To ensure the response (including any errors) can be properly associated with the function call, a `callId` must be specified with the `CallFunctionMessage`. The `error` response has been updated to require _either_ a `surfaceId` _or_ a `callId`.
callId --> functionCallId allowRemote --> callableFrom
Don't require `callableFrom`, but provide a default value.
* Remove the `ScalarType` and `ScalarTypeArray` as they were only
used from a single place. Just inline the values.
* Declare the `FunctionCall` `returnType` as a simple `enum` instead
of the `anyOf` combining references and consts.
* Since `FunctionCall` specifies a default value for `callableFrom`,
there's no reason to repeat it.
* `openUrl` is client only now; if someone really wants to enable
the server to direct the client to open a URL, they can add that
function themselves (and worry about the security implications).
Updated the `run_tests.py` to allow the test cases to specify a
different catalog. This is used for the call_function_message.json
to provide a catalog where a function has `callableFrom` set to
`clientOrRemote` and another function specifies `remoteOnly`.
f1652d9 to
6190d40
Compare
1. `DynamicStringList`: The return type if using a `FunctionCall`
needs to be one of the types declared by `FunctionCall`, so revert
back to `array`
2. `CallFunctionMessage`: Make the `description` property on
`callableFrom` match what's in the `FunctionCall`.
gspencergoog
approved these changes
Feb 24, 2026
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.
Description
Enables the server to request a function be invoked on the client. The server can specify whether it wants a response or not.
The new
CallFunctionMessagecan be sent at any time from the server, and is not associated with any surface. The function call leverages the existingFunctionCalltype, but restricts the arguments and return type to scalars (or arrays of scalars). Specifically, neither data binding nor the use of client side function calls is allowed.CallFunctionMessages are not associated with any surface.To ensure the response (including any errors) can be properly associated with the function call, a
callIdmust be specified with theCallFunctionMessage.The
errorresponse has been updated to require either asurfaceIdor acallId.Pre-launch Checklist
If you need help, consider asking for advice on the discussion board.