Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): blank question option descriptions no longer fail the run #15317

Closedtarik02(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/15317/headopened View on GitHub

Problem

Fixes #15316.

Claude often sends AskUserQuestion with an option whose description is "" or missing. It usually does this for a short trailing option like "No". The V2 user-input question contract (OrchestrationV2UserInputQuestion) requires a non-empty description, but claudeUserInputQuestions passed "" through.

The user_input_request turn item then fails to decode in ProviderEventIngestor. Run execution marks the run failed with "Provider turn failed." about 30 ms after the tool call. The Claude SDK is still blocked in canUseTool waiting for the answer, which causes three problems:

  • The question card never appears.
  • The pending request can't be answered.
  • Every next message fails with Claude provider turn … is still active until the CLI process exits.

Decoding a real failing question:

SchemaError: Expected a value with a length of at least 1
  at [2]["options"][2]["description"]

Pi's extension select dialog has the same gap. An empty-string option gets the label "Empty value", but its description stays "".

Change

  • claudeUserInputQuestions falls back to the option label when the description is blank. The Codex and OpenCode adapters already do this (nonEmptyText(option.description, option.label) / text(option.description, label)).
  • Pi's select options use "Empty value" for the description as well as the label.

I also checked the other producers of question options:

  • Codex: async questions build options with description: "", but buildUserInputRequestArtifacts already falls back to the label, so they decode.
  • OpenCode, OpenCode 2, Antigravity: already non-empty.
  • ACP: form elicitation only yields empty text for an empty-string enum value. That affects the label too, so I left it out of scope.

This doesn't change what happens to the provider turn when event ingestion fails for some other reason. #14856 covers that separately.

Scope and approval

Reported in #15316 (not yet triaged). This is a small fix for an obvious contract mismatch. The adapter produced a value that its own contract rejects, and that breaks the thread until the provider process exits. The change only touches option normalization in two adapters and matches what the other adapters already do.

Verification

  • New ClaudeAdapterV2.test.ts test "fills blank AskUserQuestion option descriptions from the label". It checks empty, whitespace-only and missing descriptions, and decodes the result against OrchestrationV2UserInputQuestion.
  • New PiAdapterV2.test.ts test "describes an empty extension select option". It drives a fake Pi select dialog with options ["stable", ""] and decodes the emitted question.
  • Before the fix: both tests fail. Claude returns ["…", "", "", ""]; the Pi decode check gives expected false to be true.
  • After the fix:
    • vp test run on ClaudeAdapterV2.test.ts, PiAdapterV2.test.ts and CodexAdapterV2.test.ts: 302 passed.
    • tsc --noEmit for apps/server: clean.
    • vp lint and vp fmt --check on the changed files: no new findings.
  • I didn't re-run the full live flow against a real Claude CLI on this branch. The failing question came from a real thread whose run failed this way twice.

Model and harness: Claude Opus 5.5 (claude-opus-5-5) in Claude Code.

    1. You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at ca846dd

      Macroscope's review found this PR approvable — This is a narrowly scoped server bug fix that normalizes blank provider option descriptions to valid fallback text without changing normal answers or schemas. Targeted regression tests cover both Claude and Pi paths, and no sensitive, deployment, product-default, or static-analysis configuration is changed.

      Notes:

      • Diff unchanged. Approvability was decided on eligibility alone.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      Important

      Review skipped

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

      ⚙️ Run configuration
      • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: dd5fdc41-e003-4e48-988a-5d226d5d999d
      📥 Commits

      Reviewing files that changed from the base of the PR and between ca846dddbccf983649e5d2b01e9b292b5d7f88b5 and 9d62332e8da08cf00083dca56304316871c5bdd4.

      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. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 3a696aa7-141d-48bd-b390-062846a212ab
      📥 Commits

      Reviewing files that changed from the base of the PR and between 429c625a8515f9c2e4af28c488fbf32ce7789645 and ca846dddbccf983649e5d2b01e9b292b5d7f88b5.

      📒 Files selected for processing (4)
      • apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
      • apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
      • apps/server/src/orchestration-v2/Adapters/PiAdapterV2.test.ts
      • apps/server/src/orchestration-v2/Adapters/PiAdapterV2.ts

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


      📝 Walkthrough

      Walkthrough

      Claude and Pi adapters now produce non-empty descriptions for user-input options with blank descriptions or values. Tests check the normalized questions against the user-input question schema.

      Changes

      User-input option descriptions

      Layer / File(s)Summary
      Normalize descriptions and validate question shapes
      apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts, apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts, apps/server/src/orchestration-v2/Adapters/PiAdapterV2.ts, apps/server/src/orchestration-v2/Adapters/PiAdapterV2.test.ts
      Claude uses the trimmed option label when a description is missing or blank. Pi uses the option label as the description and uses "Empty value" for an empty option. Tests verify the normalized questions decode against the contract schema.

      Priority: ➖ Normal

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

      Change: Bug fix · Severity of issue fixed: Medium

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to ca846

      Claude and Pi now provide non-empty descriptions for the targeted options, with adapter tests covering schema decoding. No actionable merge-blocking risk is evident; the change is ready for normal checks.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly and concisely describes the fix for blank question option descriptions that cause runs to fail.
      Description check✅ PassedThe description covers the problem, changes, scope and approval rationale, and focused verification. It also states that the live Claude CLI flow was not rerun.
      Linked Issues check✅ Passed#15316 requires non-empty option descriptions for Claude AskUserQuestion and Pi extension select questions. claudeUserInputQuestions now falls back to the option label for blank descriptions. `p…
      Out of Scope Changes check✅ PassedAll reported changes are limited to the Claude and Pi option normalization required by #15316 and tests for those changes. No unrelated changes are reported.
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Comment `@coderabbitai help` to get the list of available commands.
    5. juliusmarminge added labelsmacroscope-review

    6. Two details that #15316 doesn't have, from 0.0.46-nightly.20261005.2676 (7812230) with Claude Code 2.1.289. main at 8f75697 has the same code.

      1. The blank description doesn't depend on the model. Claude Code asks some of its own questions through canUseTool and builds their options as { label, description: description ?? "" }. One of them is the mods hot-reload prompt, "Enable hot reloading for this session?". Its three choices, "How does this work?", "Enable for this session" and "Not now", have labels and no descriptions. Claude Code asks it when a session first writes a file into its dev-mods folder, and every time it does, the run fails about 10 ms later. The label fallback in this PR covers it, since every choice has a label.

      2. Settle is blocked too. The orphaned user_input request has a live response capability, so thread.settle refuses the thread (Orchestrator.ts L2569). Killing the Claude process didn't help, because the failed run no longer reads the adapter's terminal event. The request stayed pending until the idle session release expired it, 30 minutes after Claude's turn ended and 33 minutes after the prompt.

    7. Taking over this one for batch server-misc-02. I will port the question normalization and minimal regression coverage to the current provider layout, run independent reviews, and leave the result unmerged.

    8. juliusmarminge assignedjuliusmarminge

    9. Thanks @tarik02 for identifying the contract mismatch and covering Claude and Pi. Rebuilt this as #21762 because Pi now lives in its provider package. I compared the complete original diff against the replacement: both normalizations and both regression behaviors are included, with the Pi test also checking the empty answer round trip. No original behavior was dropped. Both independent reviewers found no blockers, and all 381 focused tests pass. The replacement remains unmerged.

    10. juliusmarminge closed this

Sign in to join this conversation.