fix(mobile): thread links show their thread's title #26485
main fromrefs/pull/26485/head·merged by juliusmarminge View on GitHubProblem#
On the mobile app, a thread link in a chat message never shows the linked thread's title. On main, a <t3-thread://v2/…> link renders as "Thread no longer available" even when the thread exists and is in the list. Builds from before v2 links show the raw t3-thread:// URL instead. Reproduced on main (5211acfe95) in the Android dev client on a Pixel 9 emulator, against a dev server with a fresh database. Steps: create two threads, then put a v2 link to one into a user message and into an agent reply in the other.
Change#
threadLinkRefs collects the threads that a message's links name, so the client can load their titles. It read named capture groups from String.prototype.matchAll, but match objects from Hermes' matchAll have no groups property. On device, threadLinkRefs therefore returned [], no titles loaded, and relabelThreadLinks treated every link as unknown. relabelThreadLinks is unaffected because it reads groups from the replace callback. threadLinkRefs now walks the matches with an exec loop over a copy of the regex, and exec keeps named groups on Hermes. Results on V8 are unchanged. Web and desktop do not call threadLinkRefs.
Scope and approval#
Fixes pingdotgg/t3code#26468
Triaged via the automated issue flow.
Verification#
vp test run packages/shared/src/threadLinks.test.ts: 14/14 pass. The new test, "lists a message's thread links on runtimes whose matchAll omits named groups, such as Hermes", removesgroupsfrommatchAllresults, as Hermes does. It fails on main withexpected [] to deeply equal [ …(2) ]and passes with the fix.vp run check:changed: format, lint, knip, typecheck and tests all pass.- On device (Android dev client, Pixel 9 emulator, light theme, fresh dev database seeded through the server CLI):
- A console probe on main showed
[...s.matchAll(re)][0].groups === undefined, whilere.exec(s).groupswas present, andthreadLinkRefsreturned[]while the target thread was in the shell list. - Agent reply containing
<t3-thread://v2/<env>/mcp%3A…>(percent-encoded id, as in the report): before, "Thread no longer available"; after, a chip with the project icon and the thread title. - User message containing the same link twice, once with the plain id and once percent-encoded: before, "Thread no longer available" twice; after, both show the title chip.
- A console probe on main showed
- Not checked:
- The before/after screenshots could not be attached: the upload tool was unavailable in the environment that ran this.
- iOS was not run, though it uses the same Hermes runtime and the same code path.
- The pending-question card (
PendingUserInputCard) uses the sameuseLiveThreadLinkLabelshook and was not captured separately.
Model and harness: Claude Opus 5.5 (lead, test, implementation, review B) and GPT-6.1 Sol (review A), run through Claude Code and Codex in T3 Code.
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
79af2b8Macroscope's review found this PR approvable — Restores mobile thread-link titles by using regex iteration that retains named groups on Hermes. The change is limited to existing title rendering, with Android before/after verification reported and no changes to permissions or stored data.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 5.0 KiB +29 B (+0.6%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB +29 B (+2.3%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 21.5 KiB 21.6 KiB +41 B (+0.2%) 24.4 KiB ✅ Codex Live turn messages 1 2 +1 (+100.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.3 KiB 1.3 KiB 0 B (0.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅ Claude Live turn messages 2 2 0 (0.0%) 8 ✅ Baseline:
5211acf· PR result:79af2b8· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
No actionable comments were generated in the recent review.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: fix/issue-26468
- File: .coderabbit.config.ts
- Commit: 79af2b8
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
83634558-0900-4a34-8af0-c96eb61fa4b2
Commits-
Reviewing files that changed from the base of the PR and between 5211acfe95a0c6d82a60e2524b5e46b47fe67a3e and 79af2b8604fa3f17f15098628246793a2bb69d81.
Files selected for processing: 2-
packages/shared/src/threadLinks.test.tspackages/shared/src/threadLinks.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.
-
Walkthrough
-
threadLinkRefsnow scans markdown links with repeatedRegExp.execcalls instead ofString.matchAll. A regression test mocks matches without named groups and verifies that both v2 thread references are returned.Changes: Thread link extraction
Priority:Layer / File(s) Summary Match extraction and regression test
packages/shared/src/threadLinks.ts,packages/shared/src/threadLinks.test.tsthreadLinkRefsuses repeatedRegExp.execcalls to read link targets. The test verifies both v2 references are extracted when mockedmatchAllresults lack named groups. LowEstimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
t3dotgg
Merge Risk:
Minimal · up to79af2-
No merge-blocking issue was identified in the thread-link extraction change.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the main mobile fix: thread links now show their linked thread titles. Description check The description includes complete Problem, Change, Scope and approval, and Verification sections. It provides reproduction details, implementation context, linked issue, test results, device verificat… Linked Issues check Issue #26468reports that mobile subagent thread links do not show the linked thread information.threadLinkRefsnow usesRegExp.prototype.execand preserves named capture groups on Hermes. The ad…Out of Scope Changes check The changes are limited to the threadLinkRefsimplementation and its regression test. The implementation fixes the mobile thread-link lookup, and the test verifies that fix. No unrelated product beh…Full details: Description check
-
Explanation
The description includes complete Problem, Change, Scope and approval, and Verification sections. It provides reproduction details, implementation context, linked issue, test results, device verification, and known verification limits. Screenshots are missing, but the limitation is explicitly documented and the remaining evidence is sufficient.
Full details: Linked Issues check
-
Explanation
Issue
#26468reports that mobile subagent thread links do not show the linked thread information.threadLinkRefsnow usesRegExp.prototype.execand preserves named capture groups on Hermes. The added regression test simulates missingmatchAllgroups and verifies both thread references. The reported Android verification shows the linked thread title after the change.
Full details: Out of Scope Changes check
-
Explanation
The changes are limited to the
threadLinkRefsimplementation and its regression test. The implementation fixes the mobile thread-link lookup, and the test verifies that fix. No unrelated product behavior or unrelated files are included.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge added labelsbugfix
juliusmarminge added labelspr:gate-failed
Note
🤖 Claude Opus 5.5 responding on behalf of sharull9
#26494 fixes a separate cause of #26468 on mobile, and the issue needs both PRs to be fully fixed.
- This PR fixes Hermes dropping named groups from
matchAll, which stops Android from resolving titles for[label](…)and<…>thread links. - #26494 handles bare
t3-thread://v1/…andt3-thread://v2/…URLs, like theOne agent is working: t3-thread://v2/…line in the issue's screenshot. The shared parser didn't recognize them before, so they stayed raw on every platform. It still usesmatchAll, so Android needs this PR too.
#26494 now references #26468 without a closing keyword. This PR still closes it, so if this one merges first, the issue may need to be reopened until #26494 lands.
- This PR fixes Hermes dropping named groups from
I'm seeing this on iPhone too: valid v2 thread links render as 'Thread no longer available' even though the destination threads still exist. Explicitly labelled v1 links work in the same client. Thanks for investigating. Posted at the user's request with AI assistance from OpenAI Codex (gpt-6.1-sol, Codex harness).
Please consider adding a regression test that runs
threadLinkRefsafter compiling the shared module withbabel-preset-expoand the Android Metro caller settings.The current test removes
groupsfrommatchAllresults on an untransformed regex. In the mobile build, Babel supplies named groups through a regex wrapper;new RegExp(THREAD_LINK_OUTSIDE_CODE)also loses that wrapper's mapping. Applying this PR's cloned-regexexecloop to the mobile-Babel regression still returns[]instead of the two expected references.Reusable regression test. It fails on main and on this PR's current implementation, and passes when the loop uses the original regex after resetting its cursor:
THREAD_LINK_OUTSIDE_CODE.lastIndex = 0; for ( let match = THREAD_LINK_OUTSIDE_CODE.exec(markdown); match !== null; match = THREAD_LINK_OUTSIDE_CODE.exec(markdown) ) { // Existing extraction logic. }That version also restored title chips and navigation in Android verification. I opened #28768 during the investigation and am closing it as a duplicate; the test and correction are available to reuse here.
juliusmarminge merged this976a231
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes