Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): a final answer followed by more work in the same run stays visible #36116

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/36116/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Mobile's run fold (deriveThreadFeedRunFolds) and zen mode (zenAnswerMessageIds) kept an assistant message with phase final_answer visible only when a steer came right after it (answersBeforeSteers). Web keeps every final_answer (retainedAssistantReplyEntryIds), so when Codex gave a final answer and kept working in the same run, mobile hid that answer in "Worked for" and in zen mode. The helper is now finalAnswerIds and returns every assistant message whose projected assistant_message phase is final_answer, matching web. Zen mode's separate rule (keep the first reply after a steer) is unchanged, and tool work such as commands still folds. Only apps/mobile/src/lib/threadActivity.ts changes. No regex or parser added. On whether this is a bug: web, the same app, shows these answers, so mobile hiding them is the app contradicting itself.

Fixes pingdotgg/t3code#36110

Reproduction on main

Commit 10fbff5ab6 (origin/main). Started T3CODE_DEV_SEED=0 vp run dev --host 0.0.0.0 on a fresh worktree database, with a stdio wrapper around the real codex binary that rewrote "phase":"commentary" to "phase":"final_answer", the same change the reporter made to the replay transcript. Added a demo git project and ran t3 thread start --provider codex --model gpt-6-luna --wait, asking Codex to say "Goal met. The README exists.", then run ls README.md, then reply "Verified: README.md is present." The projection held user_message → command → assistant_message(final_answer "Goal met…") → command_execution(ls) → assistant_message(final_answer "Verified…") → checkpoint, with the run completed. Leased an Android Pixel 9 from the pool, installed the cached dev client with vp run mobile:install android --session, started Metro, paired with the dev backend and opened the thread. Collapsed, only "Verified: README.md is present." shows below "Worked for 5.1s". Expanded, "Goal met. The README exists." sits inside the fold next to the command. I also added a unit case to the existing test "hides tool calls or everything but the final answer" in apps/mobile/src/lib/threadActivity.test.ts: [user, final_answer, command, final] with no steer. On main, both the default-fold assertion (the confirmed answer row is absent) and the zen assertion (got [user, final], expected [user, answer, final]) fail.

Evidence

Reproduced on Pixel 9, Android API 36, portrait 1080x2424, T3 Code light theme, 16pt text. Each commit used its own fresh backend and Metro bundle. Real Codex gpt-6-luna ran through the triage phase-rewriting wrapper.

Steps: ask for “Goal met. The README exists.”, then run ls README.md, then reply “Verified: README.md is present.” Wait for completion without a steer. Open the thread, expand/collapse Worked for, then check Zen mode.

ViewBeforeAfter
Commit10fbff5ab66a6170e2c7
CollapsedBefore: first final answer hiddenAfter: both final answers visible
ExpandedBefore: first final answer inside Worked forAfter: only command work expands
ZenBefore: Zen drops first final answerAfter: Zen retains both final answers
InteractionBefore recordingAfter recording

Capture driver used on both sides, portable setup and seed commands, Codex phase wrapper.

Sanitized stored sequences: base, head. Both contain the same two final_answer messages separated by the command and no steer.

Not shown:

  • iOS was not run; this proof covers the shared mobile rendering change through the real Android client.

Tests

cd apps/mobile && vp test run src/lib/threadActivity.test.ts: 53/53 pass with the fix; on the base repro commit 1 fails ("hides tool calls or everything but the final answer", expected false to be true). vp run check:changed: format, lint, knip, typecheck (2 packages), test, react compiler all pass.

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.

    1. tanstack-source added labelsbug

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

    3. Approvability

      Verdict: Approved at 6a6170e

      Macroscope's review found this PR approvable — Final answers remain visible in mobile run folds and zen mode even when more work follows in the same run. The change is confined to presentation and leaves product defaults and stored data unchanged.

      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
      Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      Mobile thread activity now retains every assistant message marked final_answer when it derives run folds and selects answers in Zen mode. A regression test covers a final answer followed by a completed command.

      Changes: Mobile final-answer retention

      Layer / File(s)Summary
      Collect final answers
      apps/mobile/src/lib/threadActivity.ts
      The feed scan collects IDs for all assistant messages marked final_answer. Run-fold derivation uses this set instead of retaining only answers immediately before a steer.
      Apply retention in Zen mode and test
      apps/mobile/src/lib/threadActivity.ts, apps/mobile/src/lib/threadActivity.test.ts
      Zen-mode selection uses the broader set and adds candidate answers followed by an assistant reply. A regression test checks that a final answer followed by a completed command remains visible in the default presentation and Zen mode.

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

      Change: Bug fix · Severity of issue fixed: Low

      Suggested reviewers: yash-singh1, flamboh

      Merge Risk: Minimal · up to 6a617

      Mobile will now keep every final-answer message visible outside the collapsed "Worked for" fold, matching web behavior. No remaining merge risk was identified.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title names the main change: mobile now keeps a final_answer message visible when more work follows in the same run. It matches the threadActivity.ts change, which retains every final_answer assis…
      Linked Issues checkPassedIssue #36110 requires mobile to keep every assistant message with phase final_answer outside the collapsed "Worked for" fold, while still folding command work. At the reviewed head, the diff to apps/m…
      Out of Scope Changes checkPassedThe whole-PR changes touch two files: apps/mobile/src/lib/threadActivity.ts and its test file apps/mobile/src/lib/threadActivity.test.ts. The threadActivity.ts diff contains only the rename and broade…
      Description checkPassedThe description follows the repository template closely. It has a clear Problem (mobile hides final_answer messages in the "Worked for" fold and zen mode when a run continues without a steer, unlike w…
      Full details: Title check

      Explanation

      The title names the main change: mobile now keeps a final_answer message visible when more work follows in the same run. It matches the threadActivity.ts change, which retains every final_answer assistant message in the run fold and zen mode. The title uses the conventional commit form and is specific enough for a teammate scanning history. It is 79 characters, slightly long but acceptable.

      Full details: Linked Issues check

      Explanation

      Issue #36110 requires mobile to keep every assistant message with phase final_answer outside the collapsed "Worked for" fold, while still folding command work. At the reviewed head, the diff to apps/mobile/src/lib/threadActivity.ts replaces answersBeforeSteers with finalAnswerIds. finalAnswerIds adds every feed entry whose message role is assistant and whose projectedItem is assistant_message with phase final_answer. deriveThreadFeedRunFolds now uses this set for retainedAnswerIds, so confirmed answers followed by more work in the same run stay visible. zenAnswerMessageIds now uses the same set as keptAnswers. Its existing rule that keeps the reply after a steer is preserved through the candidate logic, which still adds candidates when a reply follows. Command entries are not added to the set, so tool work still folds. This matches the requirement stated in #36110 and the web behavior it cites (retainedAssistantReplyEntryIds). The PR reports a new regression case in threadActivity.test.ts that fails on the base commit and passes at the head. I could not read the test diff in this checkout (changed blobs unavailable), so the test result rests on the PR description and not on inspected test code. The source change alone supports the verdict.

      Full details: Out of Scope Changes check

      Explanation

      The whole-PR changes touch two files: apps/mobile/src/lib/threadActivity.ts and its test file apps/mobile/src/lib/threadActivity.test.ts. The threadActivity.ts diff contains only the rename and broadening of the final-answer retention helper and its two call sites (run fold and zen mode). Every hunk relates to the objective in #36110. The test file change adds regression coverage for the same behavior, which is a supporting change for this objective. No unrelated refactoring, parser, or regex change appears in the reviewed diff. The PR description states that only threadActivity.ts changes; the test file change is supporting coverage and is not out of scope. I could not read the test file diff directly, so its exact content is unverified.

      Full details: Description check

      Explanation

      The description follows the repository template closely. It has a clear Problem (mobile hides final_answer messages in the "Worked for" fold and zen mode when a run continues without a steer, unlike web), a Change section (replacing answersBeforeSteers with finalAnswerIds, limited to apps/mobile/src/lib/threadActivity.ts), a Scope section that links issue #36110 as the bug report, and a detailed Verification section. Verification includes a reproduction on main with a Pixel 9 and before/after screenshots and recordings, the unit test results (53/53 passing, one regression test failing on base), and the check:changed results. It also states what was not checked (iOS). The agent/model attribution is present at the end, as the template requests. The description has no explicit conventional commit title in the body, but the template's title guidance applies to the PR title, which is not part of the description supplied here. Minor gaps are negligible, so the check passes.

      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 21b0b7a0573ea4d00b45c0346bec178f367d7550 and 6a6170e2c73a5462fe7df4f31a28404a4257bc0c.

      Files selected for processing: 2

      • apps/mobile/src/lib/threadActivity.test.ts
      • apps/mobile/src/lib/threadActivity.ts

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

    5. juliusmarminge merged thisa044f0c

    6. juliusmarminge closed this

Sign in to join this conversation.