Skip to content

fix(client-runtime): answered questions show the picked option's label, not its value - #46704

Merged
juliusmarminge merged 2 commits into
mainfrom
factory/issue-46698
Dec 1, 2026
Merged

juliusmarminge merged 2 commits into
mainfrom
factory/issue-46698

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

After answering an agent's multiple-choice question, the answered-question row in the timeline showed the raw value sent to the provider instead of the option you picked. For Antigravity's ask_question that value is a 1-based index, so the row read "What should we do next? 1". The row now shows the option's label, e.g. "Add focused tests". This also fixes older threads, because the saved question still has its options.

  • getQuestionAnswerText and getQuestionAnswerPreview in packages/client-runtime now take the request's questions and turn stored values back into option labels.
  • The web/desktop timeline row (TimelineWorkEntryRow) and the mobile work log (thread-work-log, QuestionAnswerHistory) pass in the questions from the user_input_request item.

Fixes #46698

Reproduction on main

Commit: origin/main eca5cb0. Started the web dev server in a fresh worktree with T3CODE_DEV_SEED=0 GOOGLE_GEMINI_BASE_URL=<hub> vp run dev (fresh database). Paired the browser, then Settings > Providers > Add provider > Antigravity with sign-in method "Gemini API key" and a dummy key, then Connect (Antigravity v1.5.21, Authenticated). Started a new thread on Gemini 4 Neon and asked it to use ask_question for one single-choice question, "What should we do next?", with options "Add focused tests" and "Refactor the module". The question card showed both labels (with badges 1 and 2). I picked "Add focused tests" and submitted; the agent replied "Add focused tests". The answered-question row in the timeline then read "What should we do next? 1" when collapsed. Expanded, it read "What should we do next?" with the answer "1". The label never appears in the history. Failing unit test on branch factory/repro-46698 (packages/client-runtime/src/work-log/userInput.test.ts): getQuestionAnswerText("1", question) returns "1" instead of "Add focused tests". Mobile uses the same client-runtime helpers (QuestionAnswerHistory.tsx, thread-work-log.tsx). I did not run mobile.

Evidence

On each commit, start the real web dev stack with T3CODE_DEV_SEED=0 and a fresh database. Configure Antigravity v1.5.21 in Gemini API-key mode against the authorized hub and connect. Create a synthetic Question history project. Start Gemini 4 Neon with the uploaded single-choice prompt, select Add focused tests and Submit. Capture collapsed and expanded history. Repeat in a second thread with the uploaded multi-select prompt, selecting both Add focused tests and Refactor the module. Compare two screenshots 500 ms apart before each web still. Record through expanded history and inspect the videos, including their final frames. Separately run the head iOS bundle against the base server's saved single-choice thread and expand its history.

Web: Chromium on Linux, light theme, 1280×633; separate fresh databases. Real Antigravity v1.5.21 / Gemini 4 Neon. Base shows 1 and 1, 2; head shows the selected labels in collapsed and expanded history.

Capture Before — eca5cb0c0f After — a4c86ac9af
Single choice, collapsed Before Single choice collapsed After Single choice collapsed
Single choice, expanded Before Single choice expanded After Single choice expanded
Multi-select, collapsed Before Multi-select collapsed After Multi-select collapsed
Multi-select, expanded Before Multi-select expanded After Multi-select expanded
Single-choice recording Before After
Multi-select recording Before After

Reproduction driver and prompts. The multi-select recordings are cropped equally to omit the environment panel. All four recordings end on expanded history; their final frames were inspected and are not black.

Supplemental older-thread check: head iOS app, pooled iPhone 17 Pro / iOS 27.2, light theme, 402×874, reading the single-choice answer saved by the base server. The environment subtitle is redacted. This is an inspected supplemental screenshot, not a completed paired mobile proof.

Head iOS displays the label for an answer saved before the fix

Mobile before/after comparison remains unverified: VM stalls expired the leases, and the base Metro watcher failed. No base mobile capture or mobile multi-select capture was completed.

Not shown:

  • Paired mobile collapsed preview, expanded history and accessibility-label comparison: no base iOS capture or mobile multi-select capture was completed; heavy VM stalls expired device leases and base Metro initially failed its watcher. The supplemental head iOS single-choice screenshot was inspected but was not captured with the required two-frame stability check.
  • Older multi-select threads across an upgrade were not captured. Older single-choice behavior was observed only in the head iOS client reading the real base server's saved answer; standard web comparisons used separately created fresh threads.

Tests

  • vp test run src/work-log/userInput.test.ts (packages/client-runtime), without the fix: 1 failed, 1 passed (bug reproduced)
  • vp test run src/work-log/userInput.test.ts (packages/client-runtime), with the fix: 2 passed
  • vp run check:changed: format, lint, knip, typecheck (7 packages), tests and react compiler (3 files) all pass
  • CI on a4c86ac: all 40 checks passed

Not in this change

  • Antigravity submitting 1-based indices as option values is provider behaviour and is left as it is; only the display is fixed.

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

juliusmarminge and others added 2 commits December 1, 2026 10:24
…not provider values

Reproduces #46698.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l, not its value

Options with an explicit value are submitted as that value (Antigravity's
ask_question uses 1-based indices), and the answered-question history printed
the stored answer as-is. Map stored answers back through the request's
question options to their labels in the shared answer helpers, and pass the
questions in from the web and mobile timeline rows.

Fixes #46698

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Dec 1, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at a4c86ac

Macroscope's review found this PR approvable — Answered-question history and previews now show selected option labels on web and mobile, while retaining existing formatting when no option matches. The change is presentation-only and leaves stored answers and submission behavior unchanged.

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

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The shared answer formatter now resolves option values to labels when given question definitions. Web and mobile previews and answer histories pass those definitions to the formatter. Tests cover scalar answers, arrays, and previews.

Changes: Question answer labels

Layer / File(s) Summary
Resolve answer values to option labels
packages/client-runtime/src/work-log/userInput.ts, packages/client-runtime/src/work-log/userInput.test.ts
The shared formatter accepts question options and displays matching option labels for scalar and array answers. Preview formatting matches questions by ID. Tests cover these cases.
Pass question definitions to answer displays
apps/mobile/src/features/threads/QuestionAnswerHistory.tsx, apps/mobile/src/features/threads/thread-work-log.tsx, apps/web/src/components/chat/TimelineWorkEntryRow.tsx
Web and mobile previews and expanded histories provide question definitions to the formatter. Answer history matches each answer to its question by ID.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: yash-singh1

Merge Risk: Minimal · up to a4c86

Answered-question history now shows the selected option's label instead of the raw value. Callers on web and mobile pass the question definitions through. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: answered-question rows now show the picked option's label instead of the raw stored value. It follows the conventional commit format. It matches the changeset in clien…
Linked Issues check Passed [#46698] requires collapsed answer previews and expanded answered-question history to show option labels instead of raw provider values, on Web/Desktop and Mobile, including persisted threads.

Eviden…
Out of Scope Changes check Passed All changed areas connect to the [#46698] objective. Changes are: the display helpers in packages/client-runtime/src/work-log/userInput.ts (including new userInputRequestQuestions), the web row `T…
Description check Passed The description states the problem (answered-question rows show the raw provider value, e.g. "1", instead of the selected option label), the change (helpers in packages/client-runtime resolve stored v…
Full details: Title check

Explanation

The title names the main change: answered-question rows now show the picked option's label instead of the raw stored value. It follows the conventional commit format. It matches the changeset in client-runtime, web timeline, and mobile work log.

Full details: Linked Issues check

Explanation

[#46698] requires collapsed answer previews and expanded answered-question history to show option labels instead of raw provider values, on Web/Desktop and Mobile, including persisted threads.

Evidence at head a4c86ac:

  • packages/client-runtime/src/work-log/userInput.ts: getQuestionAnswerText(value, question?) returns option.label when a string answer equals an option's value. Otherwise it keeps the existing composer-context formatting. Arrays and nested answers recurse with the same question.
  • getQuestionAnswerPreview(answer, questions?) matches each answer to its question by question ID before formatting.
  • userInputRequestQuestions(item) reads item.questions from persisted user_input_request items. This covers already-persisted threads, as the issue requires.
  • TimelineWorkEntryRow.tsx (web/desktop) and thread-work-log.tsx / QuestionAnswerHistory.tsx (mobile) pass these questions into the helpers, per the change summary.
  • userInput.test.ts adds tests for scalar "1", array ["1","2"], and preview cases. They expect labels "Add focused tests" and "Refactor the module".

The mobile wiring is confirmed only from the change summary, not from a read of the mobile files. The PR states mobile was not run. That gap does not affect a coding-requirement verdict. The evidence section (screenshots) is a non-coding item.

Full details: Out of Scope Changes check

Explanation

All changed areas connect to the [#46698] objective. Changes are: the display helpers in packages/client-runtime/src/work-log/userInput.ts (including new userInputRequestQuestions), the web row TimelineWorkEntryRow.tsx, the mobile files QuestionAnswerHistory.tsx and thread-work-log.tsx that pass questions through, and unit tests in userInput.test.ts. The PR description states that Antigravity's 1-based submitted values are left unchanged, and the code changes only the display path. No unrelated behavior change appears in the evidence. The existing context-envelope test and hasQuestionAnswer keep their one-argument behavior.

Full details: Description check

Explanation

The description states the problem (answered-question rows show the raw provider value, e.g. "1", instead of the selected option label), the change (helpers in packages/client-runtime resolve stored values to option labels; web and mobile pass in questions), a linked issue (#46698), reproduction steps on main, and extensive verification including failing-then-passing unit tests, check:changed results, and before/after captures. It follows the template's Problem, Change, Scope, and Verification sections, and it ends with the model and harness used. Minor gaps: the Scope section links the issue but does not explicitly justify scope beyond that, and mobile verification is admitted as incomplete. These gaps are non-critical. The title is not part of the template check here, and the description does not use a conventional commit title line in the body, which the template comment requests.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • 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 eca5cb0 and a4c86ac.

Files selected for processing: 5

  • apps/mobile/src/features/threads/QuestionAnswerHistory.tsx
  • apps/mobile/src/features/threads/thread-work-log.tsx
  • apps/web/src/components/chat/TimelineWorkEntryRow.tsx
  • packages/client-runtime/src/work-log/userInput.test.ts
  • packages/client-runtime/src/work-log/userInput.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.

@juliusmarminge
juliusmarminge merged commit 57c1ddc into main Dec 1, 2026
41 checks passed
@juliusmarminge
juliusmarminge deleted the factory/issue-46698 branch December 1, 2026 12:37
imetn added a commit to imetn/t4code that referenced this pull request Dec 2, 2026
Ported 13 cross-layer upstream commits: pingdotgg#45961, pingdotgg#46662, pingdotgg#46705, pingdotgg#46756, pingdotgg#46750, pingdotgg#46778, pingdotgg#46840, pingdotgg#46844, pingdotgg#46891, pingdotgg#46932, pingdotgg#47015, pingdotgg#47089, pingdotgg#44864. (pingdotgg#46704 confirmed already solved with superior T4 implementation in 0a32ef3.) Preserved all locked T4 customizations including Lock pingdotgg#18 mentionMenu gating, Lock pingdotgg#21 Tiptap editor, and Task Board /board split-view fork guard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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.

[Bug]: Answered question history displays raw provider option values (e.g. '1') instead of human-readable option labels

1 participant