Skip to content

fix(pi): submit custom answers that match the hidden option - #42670

Merged
juliusmarminge merged 3 commits into
pingdotgg:mainfrom
StiensWout:wf/find-d41b687e0f767af6eb663904
Nov 25, 2026
Merged

juliusmarminge merged 3 commits into
pingdotgg:mainfrom
StiensWout:wf/find-d41b687e0f767af6eb663904

Conversation

@StiensWout

Copy link
Copy Markdown
Contributor

Pi asked users to re-enter a custom answer when it exactly matched the extension’s hidden free-text option. The Pi adapter now checks only the displayed choices and passes matching custom text to the extension’s follow-up input automatically.

Related: #37119, #29467, #40446, #30996

Reproduction on main

Commit ca81b7b97a (main), in the running web app:

  1. Open the web app from a fresh build and sign in.
  2. Start a new chat with Pi, with Pi's English ask-user-question extension enabled.
  3. Ask Pi to ask you one single-choice question that has exactly two choices.
  4. When that question is on screen, leave both choices unselected and type 3. Type something. as your own answer.
  5. Submit the answer.

A second prompt appears and asks you to type the answer again. Expected: Pi accepts 3. Type something. as the answer and the chat continues.

The cause is at packages/provider-pi/src/server/adapter.ts:3803. Ran cd packages/provider-pi && pnpm exec vp test run src/server/adapter.test.ts with the repro test added: it failed in 2 of 2 runs on a clean checkout, with expected 'ui-custom-parallel' to equal 'next-ui-custom-parallel' in the output.

Evidence

Environment: Linux x64, the repository's own tests.

Proven: the repro fails at the test commit 9f56796947 and passes on the head f287a9de38, both on main ca81b7b97a.

Before After
Commit 9f56796947 f287a9de38
Result failed with "expected 'ui-custom-parallel' to equal 'next-ui-custom-parallel'" passed

Outside view: a person sees it in the running web app by following the steps under Reproduction on main.

Tests

  • 9f56796947 adds the failing test, alone, before the fix.
  • pnpm exec vp run check:changed ca81b7b97a1c4b91e5ac25768d0f6629f37732fd passed on head.

Not in this change

  • Empty or missing answers and expired or duplicate submissions follow the existing response rules.
  • RPC send failures, missing or delayed follow-ups, and response ordering for identical question titles are handled separately from classifying an answer.
  • Extension configuration, unrecognized prompt formats, and other providers are outside this adapter path.
  • Web, desktop, and mobile share the Pi adapter, so the regression is covered there.

Who did the work

  • Repro written by GPT 6.2 Sol, in Codex
  • Outside view by Grok 4.7, in Grok
  • Duplicate check judged by Claude Opus 5.5, in Claude Code
  • Written by GPT 6.2 Sol, in Codex
  • Trimmed by Claude Opus 5.5, in Claude Code
  • Reviewed by Claude Opus 5.5, in Claude Code, and by GPT 6.2 Sol, in Codex, and by Gemini 4 Neon, in Antigravity
  • Reproduction, checks and proof run by a program on base and head, not by an agent

Made in T3 Code by GPT 6.2 Sol, Claude Opus 5.5, Grok 4.7 and Gemini 4 Neon

StiensWout and others added 2 commits November 25, 2026 07:57
Co-authored-by: GPT 6.2 Sol <codex@openai.com>
Co-authored-by: GPT 6.2 Sol <codex@openai.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 25, 2026
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f287a9d and f4b0531.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The Pi adapter now stores custom-answer options separately from the trailing sentinel and uses those options to detect custom answers. Tests cover parallel custom-answer selections and independently identified follow-up inputs.

Changes: Pi custom-answer routing

Layer / File(s) Summary
Separate options from the sentinel
packages/provider-pi/src/server/adapter.ts
The route stores option lines separately from the trailing sentinel. Custom-answer detection and the follow-up title prefix use the option lines.
Test parallel custom-answer inputs
packages/provider-pi/src/server/adapter.test.ts
The tests select the explicit “Type something.” option and check that each follow-up input has its own question ID in the next waiting request.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge, yash-singh1

Merge Risk: Minimal · previous review f287a

This fixes the Pi adapter re-prompting when a user's custom text matches the hidden "Type something." option. No concrete regression was found, so the change looks safe to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(pi): submit custom answers that match the hidden option" names the main change. The adapter now passes custom text that matches the hidden free-text option to the follow-up input, inste…
Description check Passed The description follows the template. It has a Problem section that gives the expected behavior and reproduction steps, and a Change section that explains the fix. The Scope section links related issu…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(pi): submit custom answers that match the hidden option" names the main change. The adapter now passes custom text that matches the hidden free-text option to the follow-up input, instead of asking the user to re-enter it. The title is specific, uses a conventional commit prefix, and matches the objectives and the summarized changes in adapter.ts and adapter.test.ts.

Full details: Description check

Explanation

The description follows the template. It has a Problem section that gives the expected behavior and reproduction steps, and a Change section that explains the fix. The Scope section links related issues but does not clearly state that the work is a bug fix for a linked issue. The Verification section gives focused test results with before and after commits, and it names the test command and outcomes. It also lists exclusions and author attribution. The description is mostly complete. The Scope section could state more clearly which issue shows the bug, since the Related links only list issue numbers without describing them.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ca81b7b and f287a9d.

Files selected for processing: 2

  • packages/provider-pi/src/server/adapter.test.ts
  • packages/provider-pi/src/server/adapter.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 25, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Asked Pi / Claude Haiku 4.5 the exact Red/Blue question from the reproduction, left both choices unselected, typed 3. Type something., and submitted. Both sides used fresh databases, extension 2.15.0, Chromium at 1280×800, and dark theme.

Before After
024da4f7bf f4b0531835
Before: second input prompt After: exact original answer
Before recording: extension asks for the answer again. After recording: no second input; replies "3. Type something.".

Interaction driver and setup.

Base control: Green returned directly. Caveat: the first head run also avoided the extension re-prompt and delivered the correct tool result, but Haiku asked a prose clarification. The unchanged reproduction succeeded in a second fresh thread.

Not shown:

  • Consistent model obedience is not established: the first head run asked a prose clarification despite receiving the correct custom answer; the second identical run returned it exactly.
  • Desktop and mobile were not exercised; evidence covers the real Pi adapter through the web client.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 25, 2026
@juliusmarminge
juliusmarminge merged commit 2fbb071 into pingdotgg:main Nov 25, 2026
61 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants