fix(mobile): cap live work-log summaries for long approval prompts#23232

merged4
main
GitHub fork: r13/a014-cap-live-work-log-summaries-for-long-app
opened10d agobyOonly21mil
View on GitHubTwo-way sync enabledPR last imported 14h ago

Problem

#19238 capped ordinary mobile work-log labels, but the live header still gets the entire approval prompt. When an agent asks to run a long command, such as a heredoc, during an active run, liveToolActivitySummary returns the approval's detail directly. Both the lone-activity header and grouped toggle bypass the existing cap. A punctuation-free thought preview is also unbounded.

The regression fixture produces 7,219-character approval headers and a 3,299-character thought preview on the base. Native visual clipping still leaves those full strings in layout and accessibility. This follows up on #17380; it does not claim a new ANR reproduction.

Change

Reuse compactWorkEntryText in the live summary's reasoning and fallback branches, and in the thought preview. The existing helper folds whitespace and limits text to 200 characters, plus ... when truncated. Full source items, expanded details and copy remain intact.

Three focused cases exercise the public feed and presentation functions. They cover a lone waiting approval, a grouped approval and a running thought without sentence punctuation. The approval cases also check full detail and copy preservation.

Scope and approval

This completes the mobile label cap for #17380, using the same helper and limit as the merged fix. Maintainer triage supports short single-line labels with full details and copy retained.

The shared iOS and Android presentation code changes. Approval policy, provider protocol, web and desktop are unchanged. Live checks found no competing fix. Open #21234 changes command-prefix selection in a separate branch of the summary function. Open #23128 adds model-capacity handling in other hunks of the same file.

Verification

  • Base 05696c636e with the final tests: 33 pass, 3 fail. Candidate: 36 pass with vp test run src/lib/threadActivity.test.ts --project unit --maxWorkers=1 from the mobile package.
  • Mobile tsc-rs --noEmit passes. vp fmt --check --threads 2 and vp lint --threads 2 pass for the two changed files.
  • Real Android 16 emulator and iOS 26.5 simulator runs used base and candidate Release builds with embedded production Hermes bundles and Updates disabled. The repository's ACP mock supplied the fixtures; no Metro server was used.
  • On both platforms, native approval-header text drops from 312 to 203 characters, and the thought preview from 9,198 to 203. Full approval details stay visible. Native long-press copy preserves the full prompt. Group expansion and Allow once work; both iOS approval requests completed.

The native thought capture shows completed reasoning retained in a live work group while approval is waiting. Running reasoning is covered by the unit test. Not checked: native first-chunk/running-reasoning delivery, input-dispatch latency, ANR behavior or physical devices. No responsiveness improvement is claimed.

Prior PRs: #19238, merged, by Quy Ngoc Nguyen (@Pipyakas), introduced the helper reused here. Hossein Amirkhalili (@amihos) reported the underlying native-label problem in #17380. No closed same-fix replacement was found.

Android Release, base left and candidate right. Both headers clip visually, but the base header's native text holds the whole 312-character prompt and the candidate's holds one folded line of 203 characters. Lone approval, with full approval details visible:

Android lone approval before and after

Grouped approval:

Android grouped approval before and after

Thought preview at a waiting approval boundary:

Android retained thought before and after

iOS Release, base left and candidate right. Lone approval:

iOS lone approval before and after

Grouped approval:

iOS grouped approval before and after

Thought preview at a waiting approval boundary:

iOS retained thought before and after

Regression tests on the base:

Base fails three live-label regressions

Candidate with the same tests:

Candidate passes all 36 focused tests

Generated with GPT-6.1 Sol in T3 Code Nightly

Checks

22 successful · 13 skipped
All checks passed
7c65892

Added 4 commits

  • style(mobile): format approval activity test callback25397f7
  • fix(mobile): cap live work-log summaries for long approval prompts2728b36
  • fix(mobile): cap live work-log summaries for long approval prompts79ee55e
  • test(mobile): keep focused live-summary regressions7c65892
Synced from GitHub

Approvability

Verdict: Approved at 7c65892

Macroscope's review found this PR approvable — This is a narrowly scoped mobile presentation fix that reuses the existing 200-character compaction helper for live approval and reasoning previews. Full approval details and copy behavior remain intact, with focused regression coverage for grouped and ungrouped cases.

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

Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7b89362b-cf3c-4f43-b394-02acb8c25b92
📥 Commits

Reviewing files that changed from the base of the PR and between 8acbefefc51b4d281dcd04108c82baa1ab902b0e and 7c658926759c39c46f74e4217eb5cf7e2d972cdc.

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

Walkthrough

Mobile work-log labels now collapse whitespace and truncate at 200 characters. Tests verify that live approval and reasoning previews stay within the expected length and that full text remains available in activity details and copied text.

Changes: Mobile activity previews

Layer / File(s)Summary
Compact labels and preview validation
apps/mobile/src/lib/threadActivity.ts, apps/mobile/src/lib/threadActivity.test.ts
Live thought, reasoning, and fallback labels use compact text. Tests check approval and reasoning preview limits and confirm full text remains available in activity details and copied text.

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

Change: Bug fix

Possibly related issues

  • Issue 22985: This change caps the mobile live reasoning preview, but does not change the separate desktop preview.
  • Issue 15641: This change bounds mobile live reasoning and approval labels, but does not address the reported Reanimated commit starvation.

Suggested reviewers: juliusmarminge, t3dotgg

Merge Risk: External image Minimal · up to 7c658

The mobile previews are capped while full details remain available; no identified issue blocks merging.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title is concise, specific, and accurately describes the main change: capping long live mobile work-log summaries for approval prompts.
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Description checkPassedThe pull request description includes all required sections: Problem, Change, Scope and approval, and Verification. It explains the regression, implementation, linked issue and maintainer approval, fo…
Full details: Description check

Explanation

The pull request description includes all required sections: Problem, Change, Scope and approval, and Verification. It explains the regression, implementation, linked issue and maintainer approval, focused test results, platform checks, limitations, and UI evidence. It also identifies the model and harness used.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

No changed behavior could be exercised on this Linux Boat VM. This is an unverifiable result, not a passing verification.

I inspected the description, full diff, commits, discussion and inline review comments at 7c658926759c39c46f74e4217eb5cf7e2d972cdc. The PR is open and its listed commits have no authorship by juliusmarminge or t3dotgg. GitCafe mirror: https://git.cafe/pingdotgg/t3code/pulls/23232. Stored CI status reports 28 successful checks; I did not treat that as runtime proof.

The production change is confined to apps/mobile/src/lib/threadActivity.ts: compacting live thought previews, reasoning summaries and fallback approval summaries. The user path is a native mobile thread with an active provider turn and a long approval prompt or reasoning preview. Web and desktop do not execute this presentation code.

Native prerequisite check: T3 device_list returned exactly Agent device access is turned off for this environment. The repository mobile verification skill requires stopping verification when device access is unavailable. No server, provider turn or substitute browser rendering was started, and no source changes were made. No runtime screenshots or recordings were captured.

Not verified

Main reproduction and PR-head runtime verification, both native iOS and Android; real Codex gpt-6.1-sol delivery into the changed native client; lone and grouped approval header caps; running reasoning previews; full detail expansion and copy preservation; group expansion and Allow once. These require an enabled native device host. Existing author screenshots and CI results were not reused as independent evidence.