Fix/pi ask user submit#1188
Merged
Merged
Conversation
a5bff2c to
f7123d6
Compare
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.
Linked issue
No issue filed. This was found while manually validating Pi
ask_userbehavior in the Paseo test app.Type of change
What does this PR do
Fixes the Pi provider's
ask_userflow in Paseo when Pi is running in RPC/headless mode.Problem
Pi's
ask_userextension does not expose its rich interactive UI over RPC. In headless/RPC mode it falls back to a sequence of extension UI dialogs:selectfor the main answerinputfor a comment whenallowComment: trueinputfor custom/freeform text whenallowFreeform: trueand the user chooses the freeform sentinelBefore this PR, Paseo bridged each Pi dialog directly as its own permission card. That caused a few user-visible problems:
Fix
This PR keeps Pi's RPC protocol intact, but changes the Paseo bridge so the UI matches the user's mental model:
inputprompts are now mapped as skippable question permissions:allowEmpty: truedismissLabel: "Skip"""instead of treating the prompt as cancelledask_usercalls withallowComment: trueand single-select options are presented as one Paseo permission card:selectrequest with the selected valueinputwith that comment, or""if left blankselectrequestinputwith the custom answerquestion-form-card-core.tsand covered with unit tests so optional empty answers and option-only questions are deterministic.docs/providers.mdnow documents the Pi RPCask_userfallback and Paseo's combined-permission behavior.How did you verify it
Automated checks
Ran formatting and linting:
Ran targeted typecheck and tests for the changed server/app logic:
Result:
I also tried the app workspace typecheck locally:
That is currently blocked in my local checkout by unrelated/stale dependency issues after rebasing onto current
main:src/terminal/runtime/terminal-emulator-runtime.ts:scrollbaroption not present in local xterm typingssrc/utils/rich-clipboard.ts: missingmarkdown-itdeclaration filevitest.config.ts: missing@vitest/browser-playwrightThose errors are outside the files changed by this PR.
Manual web validation
Validated with an isolated dev app/daemon so the main daemon on
localhost:6767was not touched.Setup used for manual validation:
PASEO_HOME=/tmp/paseo-dev-manual-verify-homehttp://app.localhost:1355http://daemon.localhost:1355/opt/homebrew/bin/piReproduction before the final fix:
ask_userwith:options: ["Alpha", "Beta"]allowComment: trueallowFreeform: falseinput, so the user had to interact with a second page just to finish the sameask_userrequest.Validation after the fix:
Start the dev app and isolated daemon.
Create a Pi validation agent with this prompt:
Observed a single pending permission named
Pi ask_user.In the browser, the permission card showed the answer options and optional comment in one form.
Submitted once.
Confirmed there was no second pending permission.
Confirmed the Pi agent completed and summarized both the selected answer and comment.
I also verified the same flow through the CLI permission path by allowing the pending permission with:
{"answers":{"Response":"Beta","Comment":"combined works"}}Observed result:
idlePendingPermissionsbecame[]Betacombined worksChecklist
npm run typecheckpassesnpm run lintpassesnpm run formatran (Biome)