Repository navigation
Conversation
An input dialog with placeholder "" produced an empty question, which fails the user input contract and fails the run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped Pi adapter bug fix that falls back from blank input text to the dialog title, preserving existing nonblank behavior and response handling. A focused regression test covers the affected path, with no product-default or static-analysis configuration changes. You can add or adjust custom eligibility rules. Learn more. |
Contributor
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.
Problem
A Pi extension that asks for free text with a blank placeholder fails the whole run.
@juicesharp/rpiv-ask-user-questiondoes this: picking its "Type something." option opens an input dialog with an empty placeholder. The thread shows "Provider turn failed." while Pi keeps waiting on the dialog, and the next message fails with "the previous turn is still running" (#22405).The cause is in
piQuestion. It builds the question withmessage ?? placeholder ?? title.??keeps empty strings, soplaceholder: ""becomes the question. The user input contract requires a non-blank question, so ingesting theuser_input_requestitem fails and the run fails with it.Change
piQuestionnow uses the first ofmessageandplaceholderthat has non-whitespace text, and falls back to the title otherwise. A dialog with a real placeholder, or with none, behaves as before.Scope and approval
Fixes the field that fails validation in #22405. Julius triaged it on Linux, left it open, and noted that verifying it needs Pi with the question extension configured. The real-app run below uses Pi with a local extension that sends the same dialog.
This PR fixes the bad event only. It does not touch the issue's second point, where building
ProviderEventNormalizeErrorthrows instead of returning a typed error. #23169 separately recovers a thread after any ingestion failure; the two do not overlap.Verification
adapter.test.ts: a realextension_ui_requestwithmethod: "input", a multiline title andplaceholder: "". It decodes the questions through theOrchestrationV2UserInputQuestioncontract, checks the question is the title, and checks Pi gets the exact answer.adapter.ts: fails withSchemaError: Expected a non-blank string at [0]["question"].adapter.test.tsin full: 84 passed.tsc-rs --noEmit), lint and format check: all exit 0.Real app, production builds of main and this branch on Linux, with the real Pi 1.3.0 CLI, a local chat-completions stub instead of a model, and a small personal Pi extension whose tool calls
ctx.ui.inputwith a five-line title and""as the placeholder.ask_text. The server logs "provider event ingestion failed" with "Schema validation failed". Sending "hello" then fails with "the previous turn is still running". This matches Pi run fails with "Provider turn failed." when a question's "Type something" option opens a follow-up input dialog #22405.answer: SQLite with WAL), the turn finishes, and a second ask in the same thread works. Picking "Submit empty value" also finishes the turn with an empty answer. The server logs no ingestion failure.Main, after the dialog opens and a follow-up message:
This branch, the question card with a typed answer before Submit:
This branch, after Submit (the first turn used "Submit empty value"):
The regression test on main and on this branch:
Not checked: the published
rpiv-ask-user-questionextension itself, a real model, desktop and mobile clients, macOS and Windows.Prior PRs: none attempted this fix. #21762 fixed the same kind of failure for blank select options in this function, and the new test follows its pattern. Thanks to @TheAsda for the detailed report in #22405, which named the input dialog and its empty placeholder. My open #22463 changes the header in the same function for titles shown twice, and the two conflict in
adapter.ts. This PR should land first, since it fixes a failed run and #22463 only changes what the card shows. #22463 then rebases so its detail text takes the first non-blank message or placeholder.Production fix, tests, PR description and images written with Claude Opus 5.5 in T3 Code Nightly.
🤖 Generated with Claude Opus 5.5 in T3 Code Nightly