GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(mobile): don't send or paste attached threads a machine can't read by NikitaMGrimm · Pull Request #18322 · pingdotgg/t3code

fix(mobile): don't send or paste attached threads a machine can't read #18322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
juliusmarminge merged 18 commits into pingdotgg:main from NikitaMGrimm:resubmit/reference-machine-selection-mobile
Oct 20, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix(mobile): don't send or paste attached threads a machine can't read #18322

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
21c9584
fix(composer): don't send attached threads to a machine that can't re…
NikitaMGrimm Oct 9, 2026
babc682
fix(mobile): drop pasted threads owned by another machine
NikitaMGrimm Oct 9, 2026
4894986
fix(web): blame attached threads only when no machine owns them
NikitaMGrimm Oct 9, 2026
ab2c9e2
fix(mobile): explain dropped foreign threads and don't count them aga…
NikitaMGrimm Oct 9, 2026
e15c511
fix(mobile): show attachment and thread paste warnings together
NikitaMGrimm Oct 9, 2026
7584e35
fix(mobile): keep pasted threads when the destination machine is unknown
NikitaMGrimm Oct 11, 2026
aa958fa
refactor(web): leave the web half to its own pull request
NikitaMGrimm Oct 11, 2026
beda35d
fix(mobile): clarify unavailable thread warnings
NikitaMGrimm Oct 11, 2026
b241e2a
Merge remote-tracking branch 'origin/main' into resubmit/reference-ma…
NikitaMGrimm Oct 15, 2026
0af3440
Merge remote-tracking branch 'origin/main' into resubmit/reference-ma…
NikitaMGrimm Oct 15, 2026
6a1784c
Merge remote-tracking branch 'origin/main' into resubmit/reference-ma…
NikitaMGrimm Oct 16, 2026
c19def9
Merge remote-tracking branch 'origin/main' into pr18322
NikitaMGrimm Oct 18, 2026
633d504
Merge remote-tracking branch 'origin/main' into resubmit/reference-ma…
juliusmarminge Oct 19, 2026
c28e806
test(mobile): cover mixed context paste across machines
juliusmarminge Oct 19, 2026
b326cfb
refactor(mobile): share attached thread validation when pasting
juliusmarminge Oct 19, 2026
1ecea4f
fix(mobile): keep skipped pasted thread references unavailable
juliusmarminge Oct 19, 2026
2d4b2d7
Merge remote-tracking branch 'origin/main' into L70-18322
juliusmarminge Oct 20, 2026
703f36b
Merge remote-tracking branch 'origin/main' into L70-18322
juliusmarminge Oct 20, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(mobile): share attached thread validation when pasting
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge committed Oct 19, 2026
commit b326cfb6aa92a6b3a64dd3fdc15dc06374835339

There are no files selected for viewing

21 changes: 9 additions & 12 deletions 21 apps/mobile/src/components/ComposerEditor.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,15 @@ export function ComposerEditor({
);
return;
}
const warnings = [
...(result.failures.length > 0
? [
"Some attachments could not be copied. Reconnect to the source environment and copy them again.",
]
: []),
...(result.skippedThreads.length > 0
? [
`${result.skippedThreads.map((title) => `"${title}"`).join(", ")} ${result.skippedThreads.length === 1 ? "is" : "are"} on another machine.`,
]
: []),
];
const warnings: string[] = [];
if (result.failures.length > 0)
warnings.push(
"Some attachments could not be copied. Reconnect to the source environment and copy them again.",
);
if (result.skippedThreads.length > 0)
warnings.push(
`${result.skippedThreads.map((title) => `"${title}"`).join(", ")} ${result.skippedThreads.length === 1 ? "is" : "are"} on another machine.`,
);
if (warnings.length > 0)
Dialog.alert(
"Some context is unavailable",
Expand Down
1 change: 0 additions & 1 deletion 1 apps/mobile/src/features/threads/new-task-flow-provider.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,6 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
if ((text.length === 0 && draft.attachments.length === 0) || !draftModelSelection) {
return null;
}
// A thread attached on another machine is unreadable here; the submit path explains why.
if (
threadContextsOutsideEnvironment({
text: draft.text,
Expand Down
27 changes: 12 additions & 15 deletions 27 apps/mobile/src/lib/composerContextClipboard.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
decodeComposerContextFragment,
encodeComposerContextFragment,
} from "@t3tools/shared/composerContextClipboard";
import { threadContextsOutsideEnvironment } from "@t3tools/shared/composerContextReferences";
import { executeAtomQuery, squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
import { resolveAssetUrl } from "@t3tools/client-runtime/state/assets";
import * as Option from "effect/Option";
Expand Down Expand Up @@ -71,20 +72,16 @@ export async function importComposerContextClipboard(
decodeComposerContextFragment(input.fragment) ?? decodeComposerContextClipboardHtml(input.html);
if (!fragment) return null;
const selected = referencedComposerContext(input.text, { version: 1, records: fragment.records });
// The agent can only read threads on its own server; a pasted foreign one is dropped and its
// reference stays visibly unavailable, like an attachment that failed to copy.
const skippedThreads: string[] = [];
const retained = (selected?.records ?? []).filter((record) => {
if (
record.kind !== "thread" ||
!("threadId" in record) ||
destinationEnvironmentId === undefined ||
record.environmentId === destinationEnvironmentId
)
return true;
skippedThreads.push(record.title);
return false;
});
const skippedThreads =
destinationEnvironmentId === undefined
? []
: threadContextsOutsideEnvironment({
text: input.text,
records: selected?.records ?? [],
environmentId: destinationEnvironmentId,
});
const skippedIds = new Set(skippedThreads.map((record) => record.contextId));
const retained = (selected?.records ?? []).filter((record) => !skippedIds.has(record.contextId));
if (existingContextCount + retained.length > COMPOSER_CONTEXT_MAX_RECORDS)
throw new Error("Remove some context items from the draft before pasting more.");
const imported = reidentifyComposerContext(input.text, retained, uuidv4);
Expand Down Expand Up @@ -114,7 +111,7 @@ export async function importComposerContextClipboard(
context: { version: 1 as const, records },
attachments,
failures,
skippedThreads,
skippedThreads: skippedThreads.map((record) => record.title),
};
} catch (error) {
await Promise.all(
Expand Down
5 changes: 1 addition & 4 deletions 5 packages/shared/src/composerContextReferences.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,7 @@ export function projectComposerContextForProvider(input: {
return `${body}\n\n<${CONTEXT_ENVELOPE_TAG} version="1">\n${entries.join("\n")}\n</${CONTEXT_ENVELOPE_TAG}>`;
}

/**
* Attached threads an agent on `environmentId` cannot read: `t3_thread_read` only sees its own
* server's threads, so a draft moved to another machine strands these references.
*/
// Thread history is only readable from the environment that owns it.
export function threadContextsOutsideEnvironment(input: {
text: string;
records: ReadonlyArray<ComposerContextRecord>;
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.