Repository navigation
fix(mobile): don't send or paste attached threads a machine can't read - #18322
NikitaMGrimm wants to merge 8 commits into
Conversation
Also explain attached threads when Auto routing finds no machine that can read them.
…inst the paste cap
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk | ⚪ Minimal · up to
|
…d (personal import pingdotgg#18322)
…d (personal import pingdotgg#18322)
…d (personal import pingdotgg#18322)
Split out of #18310 at the triage bot's request there. This PR covers the native mobile composer; #18310 covers web and desktop.
Problem
An agent can only read threads on its own server. On mobile, the new-task composer still sends a thread reference to a machine that doesn't own the thread, and pasting a thread copied from another machine keeps it. The agent then gets
thread_not_foundfromt3_thread_read. #18310 fixes the same gap in the web and desktop composer.Change
threadContextsOutsideEnvironmentinpackages/sharedis the check, the same one fix(composer): don't send attached threads to a machine that can't read them #18310 uses on web. Both PRs add it with identical content, so whichever merges second rebases to a no-op for those two files.The warnings use the existing native alerts: "Some context is unavailable" for paste and "Attached thread unavailable" for submit. They explain that the thread is on another machine; the submit warning tells the user to switch back or remove it from the draft.
No server, contract or web changes.
Scope and approval
Same basis as #18310: CONTRIBUTING.md's focused obvious-bug exception. A valid thread reference silently becomes unreadable when sent from a machine that doesn't own it.
Verification
vp test run packages/shared/src/composerContextReferences.test.ts apps/mobile/src/lib/composerContextClipboard.test.ts: 28 passed. The paste test for a foreign thread fails onmain, where the thread is kept and counts against the context limit. A second test covers the unknown-destination case.tsc --noEmit -p apps/mobile/tsconfig.json: pass. Scoped formatting andgit diff --check: pass. Scoped lint: no errors; 12 existing warnings outside the edited lines.ac2cc78d4acaptures and refreshed the fixed captures at PR headbeda35de70for the final warning copy. Actual native copy/paste and project selection were exercised against two independent T3 environments. On the baseline, paste kept the foreign thread and submit created a task on the destination; its GPT-6 Luna provider reportedthread_not_found. On the current head, paste warned and marked the thread unavailable, and submit showed the guard alert while preserving the draft. Same-environment paste attached the thread without a warning in the earlieraa958fac25verification; this update changes warning text only.beda35de70after the final wording change.Android evidence
Both sides start with the same native draft and clipboard input. These short crops begin after selecting the destination project; the source thread belongs to a different environment.
Paste: long-press the empty destination composer and choose native Paste. Before, the thread stays attached. After, the warning names it and the chip is marked unavailable.
pr18322-paste-wording.mp4
Submit: attach Source notes on its owning environment, switch the draft to the destination project, then tap Start task. Before, the task is sent and the composer clears. After, send is blocked and the draft remains.
pr18322-submit-wording.mp4
Capture limits: both environments run on one Windows host with separate identities and state. Source notes is a seeded stopped-thread projection; interactions and clipboard operations are native. The same development APK was used for both revisions because native files are unchanged, with Metro restarted and its cache cleared at the PR head. Building on Windows needed isolated local toolchain workarounds; no PR source changes were made for capture. The baseline submit used GPT-6 Luna; the refreshed fixed capture selected gpt-5.4-mini, but the guard stopped submission before provider execution. Clips retain source timing and demonstrate behavior; they do not measure latency. iOS was not tested.
Note
🤖 Agent assistance: Claude Opus 5.5 via Claude Code in T3 Code (implementation); GPT-6.1 Sol via Codex in T3 Code (warning copy, Android verification and evidence)