Skip to content

fix(pi): blank extension dialog titles no longer fail the turn - #35271

Open
Kirat0201 wants to merge 3 commits into
pingdotgg:mainfrom
Kirat0201:codex/t3code-pi-blank-dialog
Open

Kirat0201 wants to merge 3 commits into
pingdotgg:mainfrom
Kirat0201:codex/t3code-pi-blank-dialog

Conversation

@Kirat0201

Copy link
Copy Markdown

Problem

Pi extensions can send an empty or whitespace-only title for input, select, or editor dialogs. T3 copies it into the question text, which fails the nonblank question contract and can fail the running turn. A blank title with a valid input placeholder also produces an invalid header.

Fixes #35237.

Change

Use the existing Question label when the dialog title is blank. Preserve nonblank titles, placeholder text, options, editor prefill, and the original answer response.

Scope

A small adapter normalization fix for a valid Pi RPC string that violates T3's stricter contract. No public API, permissions, model instructions, or rendering code changes. #23650 addresses the shared invalid-event error boundary separately.

Verification

Darwin arm64, pinned Node 26.12.1, base 591188471a6d. Production Pi adapter with the repository's existing fake Pi RPC process and production question schema, using isolated development state. No model calls.

Before the fix, six cases fail with SchemaError: Expected a non-blank string at [0]["question"]: input, select, and editor with empty or whitespace-only titles. The three normal-title controls pass. After the fix, all 133 adapter tests pass. The extended cases also cover a blank title with a valid placeholder and verify answer round trips during an active turn.

Observed fixture round trip for each blank-title method:

Pi RPC: extension_ui_request, title="" or "   "
Adapter: user_input_request, header="Question", question="Question"
Production question decoder: accepted
Answer: SQLite
Pi RPC: extension_ui_response, value="SQLite", cancelled absent

With a valid placeholder, the question remains Your name; nonblank multiline titles remain intact. Existing empty-answer, select-option, editor-prefill, confirmation, cancellation, and timeout tests pass.

vp run check:changed --concurrency 2 passes formatting, lint, both dependency checks, typechecks for nine affected packages, and 135 tests across two files. Commit hooks pass (format, lint, and dependency checks). Latest upstream e9e934bb3d has no intervening changes to either Pi file.

Not exercised: a real Pi extension process or packaged clients. This verifies protocol normalization and response handling through the existing adapter fixture.

GPT-6 in Codex.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 12, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 9c530ed

Macroscope's review found this PR approvable — Blank extension dialog titles now use “Question” instead of propagating empty text. The change is limited to question presentation and leaves options, responses, and approval handling unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Pi adapter now uses a trimmed title or "Question" when deriving dialog headers and questions. Tests cover title variants and answer handling for input, select, and editor dialogs.

Changes: Pi dialog title handling

Layer / File(s) Summary
Normalize dialog titles and verify responses
packages/provider-pi/src/server/adapter.ts, packages/provider-pi/src/server/adapter.test.ts
piQuestion uses the trimmed title or "Question" as a fallback. Tests cover nonblank, empty, and whitespace-only titles, question text, and returned answers for input, select, and editor dialogs.

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

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: only21mil, juliusmarminge

Merge Risk: Minimal · up to 9c530

Pi dialogs with blank titles now fall back to "Question" instead of failing the turn. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix: blank Pi extension dialog titles no longer fail the turn. The raw summary says the adapter now trims the title and falls back to "Question" when blank, and the tests cover inp…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section states the expected behavior and failure. The Change section explains the fix. The S…
Linked Issues check Passed [#35237] The whole-PR diff changes only piQuestion in packages/provider-pi/src/server/adapter.ts. It adds const questionTitle = title.trim() ? title : "Question". Blank or whitespace-only titles…
Out of Scope Changes check Passed The production change is a three-line normalization inside piQuestion, which matches the issue's requirement. The test changes in packages/provider-pi/src/server/adapter.test.ts, as summarized, co…
Full details: Title check

Explanation

The title names the fix: blank Pi extension dialog titles no longer fail the turn. The raw summary says the adapter now trims the title and falls back to "Question" when blank, and the tests cover input, select, and editor dialogs with blank titles. The title is a conventional commit, is specific, and matches the main change.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section states the expected behavior and failure. The Change section explains the fix. The Scope section explains why no issue is needed beyond the linked #35237 and states no public API changes. The Verification section gives focused test results, the observed round trip, and what was not checked. The author also names the model used at the end, as the template asks.

Full details: Linked Issues check

Explanation

[#35237] The whole-PR diff changes only piQuestion in packages/provider-pi/src/server/adapter.ts. It adds const questionTitle = title.trim() ? title : "Question". Blank or whitespace-only titles now resolve to "Question". The question field uses detail ?? questionTitle, so a blank title with a nonblank message or placeholder still yields a nonblank question. When no detail exists, header and question both use questionTitle, so neither is blank. Nonblank titles pass through unchanged, including multiline text. The confirm path and the answer response handling are not touched by this diff. The author reports adapter tests for input, select, and editor dialogs with blank titles, a valid placeholder, and answer round trips during an active turn. I did not run those tests. The code change alone establishes the nonblank question behavior. Run-continuation behavior depends on the author's reported fixture verification, which I did not reproduce.

Full details: Out of Scope Changes check

Explanation

The production change is a three-line normalization inside piQuestion, which matches the issue's requirement. The test changes in packages/provider-pi/src/server/adapter.test.ts, as summarized, cover the same blank-title cases. These support the fix and are in scope. No public API, permission, model-instruction, or rendering changes appear in the reviewed diff. The author states that #23650 covers the shared error boundary separately, and this diff does not touch it.

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 e9e934b and 9c530ed.

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; 8 remain after this review.

@sanjaibalajee

sanjaibalajee commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Tested this diff on top of main at 476fc9be6.

  • adapter.test.ts: 133 pass. Against the unpatched adapter, the 8 new blank-title cases fail with Expected a non-blank string.
  • I ran the reproduction script from [Bug]: Pi extension input, select, or editor dialogs with a blank title fail the run with "Provider turn failed." #35237 with its blank-title assertions flipped to the expected result. It drives the production Pi adapter, ProviderEventIngestorV2 and RunExecutionService against the fake Pi RPC process. All 12 cases pass. Input, select and editor dialogs titled "" and " " now produce a question that decodes, the answer SQLite reaches Pi as an extension_ui_response, and the run ends waiting with no interrupt, clear_queue or abort. On main the same six cases fail the run as described in the issue. The Which database? controls and the three confirm dialogs behave the same as on main.
  • provider-pi typecheck passes.

juliusmarminge and others added 2 commits November 12, 2026 16:38
AI-assisted; verified with the tests and tools listed above.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Pi extension input, select, or editor dialogs with a blank title fail the run with "Provider turn failed."

3 participants