Repository navigation
Conversation
tnkuehne
force-pushed
the
app-questions-docs
branch
2 times, most recently
from
December 1, 2026 11:28
ce3e2d7 to
54650c6
Compare
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 280e43d | Dec 01 2026, 03:30 PM |
tnkuehne
added a commit
that referenced
this pull request
Dec 1, 2026
…534) When an app calls another app's API as the signed-in person and that API asks a question, such as a template asking before it deletes, the person now answers it in a dialog on the calling app's open page. The calling app's code awaits the method and receives its result. It no longer receives `input_required`, needs no question UI of its own and cannot answer in the person's place. ## How it works - **Pages:** the runtime adds `<script src="/.widefleet/questions.js" defer>` to every HTML document with a `<head>` (fragments without one are left alone, so pages that insert fetched HTML do not load it twice). The 850-byte script keeps a WebSocket to the runtime and loads the dialog module (`/.widefleet/questions-dialog.js`) only when a question arrives. The dialog renders in a shadow root with the shared form fields of the MCP input form, and follows the device's light or dark setting. - **Questions:** `AppQuestions` is a Durable Object per app and person. Pages connect with hibernatable WebSockets after the runtime checks the upgrade and the page's origin. A binding call whose provider returns `input_required` connects as a second kind of hibernatable socket and sends the question; the object stores it, shows it on every open page and sleeps until someone answers. The first answer continues the call, which the gateway runs again with `ctx.props.input` as before. - **Unanswered questions:** without an open page, after the last page closes, after five minutes or once the caller's delegation expires, the provider is called again with every question cancelled and returns its own result. A provider that asks again after a cancellation fails the call. - **Bindings:** `withInput` is removed from app bindings, from the generated binding types and from the reserved method names. Generated `Result<R>` types no longer include questions. - **Configuration:** the runtime binds `WIDEFLEET_APP_QUESTIONS` (wrangler migration `v6`, and the self-hosted runtime configuration). The auth proxy rebuilds WebSocket handshakes with its usual cookie handling, so renewed sign-in cookies reach the browser. Direct MCP calls keep their native dialogs and MCP Apps forms. ## Screenshots There was no dialog before: the calling app received `input_required` and had to show the question itself. A template approval, 1280 px light and dark: <img src="https://gist.githubusercontent.com/tnkuehne/4fdcdcba59fa1dce0427408fc9cd6f39/raw/ccba4e7052297867729fbd1830d131e2696ac081/approval-desktop-light.png" width="640"> <img src="https://gist.githubusercontent.com/tnkuehne/4fdcdcba59fa1dce0427408fc9cd6f39/raw/ccba4e7052297867729fbd1830d131e2696ac081/approval-desktop-dark.png" width="640"> A question with a form field, 390 px light and dark: <img src="https://gist.githubusercontent.com/tnkuehne/4fdcdcba59fa1dce0427408fc9cd6f39/raw/ccba4e7052297867729fbd1830d131e2696ac081/form-mobile-light.png" width="260"> <img src="https://gist.githubusercontent.com/tnkuehne/4fdcdcba59fa1dce0427408fc9cd6f39/raw/ccba4e7052297867729fbd1830d131e2696ac081/form-mobile-dark.png" width="260"> <details><summary>Remaining variants</summary> <img src="https://gist.githubusercontent.com/tnkuehne/4fdcdcba59fa1dce0427408fc9cd6f39/raw/ccba4e7052297867729fbd1830d131e2696ac081/approval-mobile-light.png" width="260"> <img src="https://gist.githubusercontent.com/tnkuehne/4fdcdcba59fa1dce0427408fc9cd6f39/raw/ccba4e7052297867729fbd1830d131e2696ac081/approval-mobile-dark.png" width="260"> <img src="https://gist.githubusercontent.com/tnkuehne/4fdcdcba59fa1dce0427408fc9cd6f39/raw/ccba4e7052297867729fbd1830d131e2696ac081/form-desktop-light.png" width="640"> <img src="https://gist.githubusercontent.com/tnkuehne/4fdcdcba59fa1dce0427408fc9cd6f39/raw/ccba4e7052297867729fbd1830d131e2696ac081/form-desktop-dark.png" width="640"> </details> Not checked: Safari and Firefox rendering, apps that set their own restrictive CSP in HTML. ## Tests - `app-services-runtime.test.ts` on workerd and celld: a question reaches an open page and the answer continues the call; questions are cancelled without a page and when the last page closes; a question near the 16 KiB limit with a character outside Latin-1; pages of other origins are refused; the dialog in Chromium from click to result. - Page HTML and ETag expectations in the Cloudflare runtime and dynamic celld suites; binding type expectations. - `pnpm check`, `cargo test -p platform-agent runtime`. The lint error in `templates/hubspot/tests/provider.ts` comes from `main`. ## Documentation The guides "Ask the user before continuing" and "Approve changes" are updated in the draft docs PR #535.
tnkuehne
force-pushed
the
app-questions-docs
branch
from
December 1, 2026 12:19
54650c6 to
74df5cc
Compare
tnkuehne
force-pushed
the
app-questions-docs
branch
from
December 1, 2026 13:09
74df5cc to
e3f5d67
Compare
tnkuehne
force-pushed
the
app-questions-docs
branch
from
December 1, 2026 15:29
e3f5d67 to
280e43d
Compare
This branch has not been deployed
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.
Updates Ask the user before continuing and Approve changes for #534 and #536: a question from an app call reaches the person where they started, in the agent's client when an agent called the app, or in a dialog on the calling app's open page. The calling app receives the method's result;
withInputis no longer part of bindings.Blocked until a release contains #534 and #536. The required runtime version reads "released after 0.7.23"; adjust it if that release carries another number.