Skip to content

Add support for calling input plane functions #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thecodingwizard
Copy link

This PR adds libmodal support for calling input plane functions. This requires a few changes:

  1. Support multiple ModalClientStubs pointing to different server URLs.
  2. Propagate x-modal-auth-token from FunctionGet to the input plane RPCs.
  3. Implement the new set of RPCs for the input plane.

We will need to add support for retrying internal failures next.

Note that this PR cannot be merged until we enable input plane functions in production; otherwise, the tests will fail.

@@ -13,6 +13,8 @@ import {
import { ClientType, ModalClientDefinition } from "../proto/modal_proto/api";
import { profile, Profile } from "./config";

let modalAuthToken: string | undefined;
Copy link
Author

@thecodingwizard thecodingwizard May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the way we propagate auth tokens is a little different in Go vs. Typescript.

In Typescript (and Python), we propagate auth tokens via auth middleware / a grpc interceptor in client.ts.

In Go, we propagate auth tokens via context in function.go.

I'm open to changing Go's implementation to also propagate auth tokens via grpc interceptors in client.go for consistency if we think that's better, but it might be a bit trickier since Go is multithreaded? Regardless, we can always change our minds later.

@thecodingwizard thecodingwizard force-pushed the nathan/inputplane branch 2 times, most recently from 0601472 to 52b14c5 Compare May 19, 2025 15:59
@thecodingwizard thecodingwizard requested a review from ekzhang May 19, 2025 16:02
@thecodingwizard thecodingwizard marked this pull request as ready for review May 19, 2025 16:02
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.

1 participant