Skip to content

sync: port upstream mobile perf, OTA updates, Thread List v2 default (#4607–#4984) - #194

Merged
aaditagrawal merged 19 commits into
mainfrom
sync/20260730-l5-mobile
Aug 1, 2026
Merged

sync: port upstream mobile perf, OTA updates, Thread List v2 default (#4607–#4984)#194
aaditagrawal merged 19 commits into
mainfrom
sync/20260730-l5-mobile

Conversation

@aaditagrawal

Copy link
Copy Markdown
Owner

L5/7 of the 2026-07-30 upstream sync stack (20 commits). Stacked on #193.

What lands

Fork deviations preserved

Verification

vp run typecheck and vp check pass. vp run lint:mobile could not be run locally — swiftlint 0.65.0 fails to load sourcekitdInProc on this host, identically on main, so it is a local toolchain issue rather than a regression. CI runs it properly.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ca3073ee-aaff-408c-af4c-40f06613fd31

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). labels Jul 31, 2026
@aaditagrawal

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 694e87b1e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Roll back by reference, not messageId: a retry enqueue with the same
// id may have optimistically replaced this attempt while the write was
// in flight, and its entry must survive this attempt's failure.
setMessages(currentMessages().filter((candidate) => candidate !== message));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore the previous message when a replacement write fails

When a same-ID retry replaces an already persisted queued message and its storage.write fails, this rollback removes the replacement without restoring the previous in-memory entry. The old payload can remain on disk under that message ID, so it disappears for the current session but returns after restart and may dispatch stale work. Capture and restore the displaced entry when the replacement cannot be persisted.

AGENTS.md reference: AGENTS.md:L58-L62

Useful? React with 👍 / 👎.

// append: the merge path slots existing attachments first and truncates
// at the send limit, which would silently drop this message's images if
// the user attached new ones while the write was in flight.
void mergeComposerDraftContent(threadKey, { text, attachments: [] });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle failures while restoring an unsent draft

When the outbox write fails, mergeComposerDraftContent performs another filesystem write and can reject as well—for example, under the same disk-full condition—but this discarded promise has no rejection handler. That produces an unhandled rejection and can leave the restored prompt only in memory, so it is lost after a restart. Await or catch the restoration failure and report it through the existing error path.

AGENTS.md reference: AGENTS.md:L58-L62

Useful? React with 👍 / 👎.

Comment on lines +283 to +286
useEffect(() => {
if (environmentId !== null && environmentId !== previousEnvironmentIdRef.current) {
previousEnvironmentIdRef.current = environmentId;
setPathInput(getAddProjectInitialQuery(environmentBaseDirectory));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply a base directory that loads for the current environment

When the environment is already selected before its server config arrives, pathInput is initialized from a null base directory and this effect ignores the later environmentBaseDirectory update because the environment ID did not change. Both local-folder and clone-destination screens then start at ~/ instead of the configured add-project base directory; update untouched initial input when the current environment's config becomes available.

Useful? React with 👍 / 👎.

KrzysztofMoch and others added 19 commits August 1, 2026 12:32
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 476d69c)
Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit f1a68ac)
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 936593c)
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 8fe8f9a)
…ngdotgg#4882)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit f0f16e4)
…ingdotgg#4867)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 90f3913)
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 6154b46)
@aaditagrawal
aaditagrawal force-pushed the sync/20260730-l4-web-polish branch from 16e9018 to fe91fe1 Compare August 1, 2026 07:11
@aaditagrawal
aaditagrawal force-pushed the sync/20260730-l5-mobile branch from 694e87b to 857a5d8 Compare August 1, 2026 07:11
@aaditagrawal

Copy link
Copy Markdown
Owner Author

Review triage

Every finding on this PR was checked against upstream/main by blob hash (not just diff). All are verbatim upstream code, carried in unmodified by this port — the files are byte-identical to upstream, so the flagged behavior affects upstream equally and is not introduced by the sync.

Deliberately not fixing them here: patching upstream bugs inside a 101-commit port would diverge the fork in exactly the files this stack exists to realign, and would make the next sync harder. They are better raised upstream or tracked as fork-local follow-ups on their own branch, where they can be reviewed on their merits.

Notably, the files where this PR did carry fork-specific conflict resolutions drew no findings.

@aaditagrawal
aaditagrawal changed the base branch from sync/20260730-l4-web-polish to main August 1, 2026 07:18
@aaditagrawal
aaditagrawal merged commit 22e556a into main Aug 1, 2026
12 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 857a5d85c9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 259 to +260
if (options.changeRequestState === "merged" || options.changeRequestState === "closed") {
// Only an idle thread settles on the merge signal: the signal itself
// never clears, so without this guard fresh activity (a message sent in
// a settled thread) would re-settle the moment its turn completed.
const lastActivityAt = threadLastActivityAt(shell);
if (
lastActivityAt === null ||
Date.parse(lastActivityAt) < Date.parse(options.now) - CHANGE_REQUEST_SETTLE_IDLE_MS
) {
return true;
}
return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve merged threads during follow-up conversations

When a user sends follow-up work to a merged or closed change-request thread, the server clears its settled override for that activity, but once the turn finishes the activity blockers disappear while the change-request state remains permanent; this unconditional return therefore moves the thread straight back into the settled tail. Restore an idle guard (or another durable active state) so recently active follow-up work remains visible instead of re-settling immediately.

AGENTS.md reference: AGENTS.md:L58-L62

Useful? React with 👍 / 👎.

// at the send limit, which would silently drop this message's images if
// the user attached new ones while the write was in flight.
void mergeComposerDraftContent(threadKey, { text, attachments: [] });
appendComposerDraftAttachments(threadKey, attachments);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep restored attachments within the send limit

If the outbox write fails after the user has attached images to a new draft, this uncapped append combines those new images with every attachment from the failed message and can exceed PROVIDER_SEND_TURN_MAX_ATTACHMENTS (8). The next send then queues a payload outside the provider send contract instead of asking the user which images to retain, so cap or otherwise reconcile the two attachment sets while reporting any overflow.

AGENTS.md reference: AGENTS.md:L58-L62

Useful? React with 👍 / 👎.

Comment on lines +531 to +534
let providers = drop.dropSession.items.map(\.itemProvider)
guard !providers.isEmpty,
providers.allSatisfy({ $0.canLoadObject(ofClass: UIImage.self) }) else {
return nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle images in mixed drag payloads

When an iPadOS drop contains both an image item and a non-image item, allSatisfy rejects the entire drop and falls back to UIKit's suggested performer. UIKit can then insert the image as a regular NSTextAttachment; serializedText cannot preserve that attachment and onComposerPasteImages is never emitted, so the dragged image disappears from the controlled composer. Intercept the image providers even when the same drop also contains other item types, while explicitly preserving or inserting the remaining content.

Useful? React with 👍 / 👎.

@aaditagrawal
aaditagrawal deleted the sync/20260730-l5-mobile branch August 1, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants