chore: sync upstream pingdotgg/t3code (20260719)#209
Conversation
Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com> Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…gdotgg#4054) Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…gg#3608) Co-authored-by: Codex <codex@openai.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: codex <codex@users.noreply.github.com>
…obe success (pingdotgg#3621) Co-authored-by: Julius Marminge <julius0216@outlook.com>
Two merge-introduced incompatibilities from the 20260719 upstream sync: - Normalizer: upstream's client-timestamp canonicalization (da3c203) rewrote bootstrap.createThread.createdAt, which BootstrapTurnStartDispatcher uses to fingerprint a replayed bootstrap turn against the thread it already created. Every retry would miss that check and create a duplicate thread. Keep the client's bootstrap timestamp as the stable identity; the turn-level createdAt is still canonicalized. - ThreadTerminalDrawer: upstream's terminal selection copy action (1735e27) passed a Terminal to writeSystemMessage, which this fork narrowed to accept a TerminalWriteQueue. Use terminalWriterRef, matching the other call sites. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d89c08847
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| disabled={ | ||
| isConnecting || | ||
| isComposerApprovalState || | ||
| projectSelectionRequired || | ||
| (environmentUnavailable !== null && activePendingProgress === null) |
There was a problem hiding this comment.
Keep the offline composer editable for queued sends
When an environment is unavailable and there is no pending question, this makes the Lexical editor non-editable, so users who lose connection before drafting cannot type a message to queue. The send path explicitly queues initial sends while activeEnvironmentUnavailable is true, and the primary action still advertises the disconnected queue action, so this state should not block composing the queued text; keep the editor editable and let the send path handle queuing/disablement.
Useful? React with 👍 / 👎.
| const dockTransition = runMobileComposerTransition(() => { | ||
| flushSync(() => { | ||
| captureDraftHeroComposerRect(); | ||
| setDockedDraftHeroThreadKey(activeThreadKey); |
There was a problem hiding this comment.
Reset draft hero docking after attachment read failures
For draft-hero sends with images, this docks the hero before turnAttachmentsPromise is awaited; if reading an attachment fails, the early return restores the draft and removes the optimistic message but never clears dockedDraftHeroThreadKey. The still-empty draft then stays in the docked layout until navigation instead of returning to the hero, so the attachment failure path should clear this state or docking should wait until attachments are readable.
Useful? React with 👍 / 👎.
| if (latestUserMessageChanged) { | ||
| return true; |
There was a problem hiding this comment.
Match steering acknowledgements to the local send
When another client appends a steering/user message to the same running turn before this tab's send is projected, this condition treats that unrelated latest-user-message change as acknowledgement of the local dispatch. That clears the local "Sending" state for the wrong command, so the composer can stop showing that this tab's send is still pending; store/compare the submitted message id instead of accepting any latest user-message change.
Useful? React with 👍 / 👎.
| if ( | ||
| key === "Enter" && | ||
| shouldSubmitComposerOnEnter({ hasCoarsePointer, shiftKey: event.shiftKey }) | ||
| shouldSubmitComposerOnEnter({ isMobileViewport, shiftKey: event.shiftKey }) |
There was a problem hiding this comment.
Preserve coarse-pointer Enter behavior
On touch devices whose viewport is wider than the mobile breakpoint, such as tablets or Surface devices in landscape, this now passes only isMobileViewport to the Enter policy after removing the coarse-pointer guard. Plain Enter from the on-screen keyboard will submit instead of inserting a newline, regressing the previous coarse-pointer behavior; keep using pointer capability or include it in the shared helper.
Useful? React with 👍 / 👎.
| const catalog = AsyncResult.value(get(environmentCatalog.catalogAtom)); | ||
| if (Option.isNone(catalog)) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Wait for catalog readiness before settling landing
The catalog atom has an initial empty value with isReady: false, but AsyncResult.value(...) is already Some, so this atom skips the guard and returns true while the entries are still just the initial empty map. On a cold load of /, IndexDraftLanding can render the no-project hero before restored environments and shell snapshots arrive, causing a visible wrong landing state; check catalog.value.isReady before iterating or returning true.
Useful? React with 👍 / 👎.
Nightly sync of
pingdotgg/t3codeinto this fork.Range:
fdca154..1735e27(50 upstream commits). Because this fork squash-mergesto
main, the sync cherry-picks the range rather than merging.empty; spot-checked file-by-file against upstream before skipping)
Verification
vp run typecheckvp checkSidebarUpdatePill.tsx)vp test runConflicted-file set
These are the only files where this merge's resolution could introduce a bug;
everything else is upstream applied cleanly.
package.json·apps/mobile/.../showcasePendingTasks.test.ts·apps/server/src/ws.ts·apps/server/src/server.test.ts·apps/desktop/src/electron/ElectronUpdater.ts·apps/desktop/src/updates/DesktopUpdates.test.ts·apps/server/src/vcs/GitVcsDriverCore.ts(+ test) ·packages/shared/src/remote.test.ts·apps/server/src/provider/Layers/CursorAdapter.ts·apps/server/src/provider/acp/AcpSessionRuntime.ts·apps/web/src/components/chat/ChatComposer.tsx·apps/server/src/provider/CodexDeveloperInstructions.ts(+ CodexSessionRuntime.test.ts) ·apps/web/src/components/ChatView.tsx·packages/client-runtime/src/state/threads.ts(+ threads-sync.test.ts) ·apps/server/src/orchestration/Normalizer.ts·apps/desktop/src/wsl/DesktopWslEnvironment.ts·scripts/build-desktop-artifact.ts·apps/web/src/components/ThreadTerminalDrawer.tsxNotable resolutions
Fork already implemented upstream's fix — kept the fork's superset:
ws.ts(Fix dropped events during initial thread snapshot pingdotgg/t3code#4079, dropped events during initial thread snapshot): the fork alreadyattaches the live buffer before reading either the replay boundary or the
snapshot, so every return path drains it. Taking upstream's side would have
deleted the fork's audience guard, storage-epoch validation and tombstone
recovery. Ported upstream's regression test verbatim — it passes against the
fork's implementation.
GitVcsDriverCore.ts(fix(server): stabilize non-repository Git diagnostics pingdotgg/t3code#4077): all three of upstream'sLC_ALL=Cconversionsites are already converted, plus a fourth fork-local fallback. The fork's
listRefsusesfor-each-ref, so its test assertion (which still assertslcAll: "C") was kept over upstream'sbranch --no-colorexpectation.Preferred upstream:
ChatComposerEnter behaviour ([codex] fix mobile composer Enter behavior pingdotgg/t3code#3930): the auto-merge left a duplicate importof
shouldSubmitComposerOnEnter. Adopted upstream's viewport-based helper andretired the now-orphaned fork-local
ChatComposer.logic.ts+ its test.wholesale, after confirming every referenced symbol resolves in the fork.
Genuine merges (neither side alone was correct):
ChatView.tsx: took upstream's hero-landing structure but restored therequired
sessionOnlyDisconnectedSendReasonprop that upstream's variantomits, and kept the fork's debounced environment-unavailable state.
Normalizer.ts: kept both sides (fork's attachment-cleanup helpers +upstream's timestamp canonicalizer) and retargeted the fork's receipt and
attachment path at
canonicalCommand, so canonicalized timestamps actuallyreach the persisted command.
build-desktop-artifact.ts: upstream's web brand assets applied before thefork's 3-arg
validateBundledClientAssets(branding rewritesindex.html).Merge-introduced regressions found and fixed (9d89c08)
The full suite caught two real incompatibilities, both fixed rather than
papered over:
canonicalization ([codex] canonicalize client timestamps pingdotgg/t3code#4112) rewrote
bootstrap.createThread.createdAt, butBootstrapTurnStartDispatcherfingerprints a replayed bootstrap turnagainst the thread it already created using exactly that field
(
BootstrapTurnStartDispatcher.ts:133). Every retry would miss the check andcreate a duplicate thread — a production bug, not just 3 red tests. Upstream
has no such dedup, so this was not an intentional upstream behaviour change.
Fixed by keeping the client's bootstrap timestamp as the stable replay
identity while still canonicalizing the turn-level
createdAt; upstream'scanonicalizeClientCommandTimestampsand its tests are untouched.path (Add terminal selection copy action pingdotgg/t3code#2904) passed a
TerminaltowriteSystemMessage, which this forknarrowed to
TerminalWriteQueue. Switched toterminalWriterRef, matchingevery other call site.
🤖 Generated with Claude Code