Skip to content

chore(upstream): sync marcode through 9b2d0431 - #65

Draft
maarco wants to merge 132 commits into
mainfrom
claude/gracious-bohr-spsati
Draft

chore(upstream): sync marcode through 9b2d0431#65
maarco wants to merge 132 commits into
mainfrom
claude/gracious-bohr-spsati

Conversation

@maarco

@maarco maarco commented Aug 31, 2026

Copy link
Copy Markdown
Owner

What Changed

Merges 129 upstream commits, f035a0f4..9b2d0431 (pingdotgg/t3code@9b2d04317c68233782e0630464ac86d77d0686f3, "fix(mobile): replace Callstack glass with Expo glass (pingdotgg#8862)"), into main as one two-parent merge commit, plus two follow-up commits fixing what CI caught. 39 paths conflicted; every one was resolved by hand, combining both intents. This supersedes the older open sync PRs (#53, #55, #56, #58, #61, #63) — they all target the same main SHA and are subsets of this delta — and resolves the upstream-sync-blocked issue #64.

Fork-boundary breaks that merged cleanly

These produced no conflict marker and would have shipped broken. The last two were caught by CI rather than by review — both in code that is brand new from upstream, so there was nothing to conflict with:

Break Fix
Upstream's new t3 theme command read T3CODE_HOME; every other Marcode CLI command reads MARCODE_HOME, so MARCODE_HOME=… t3 theme set would silently target the default install renamed the var and its test in apps/server/src/cli/theme.ts
Three // oxlint-disable-next-line t3code/no-global-process-runtime comments (preload.ts, verify-preload-bundle.mjs, externalLauncher.test.ts) — Marcode's plugin meta name is marcode, so they were inert against a rule at "error" renamed to marcode/
Upstream's new no-mobile-uniwind-theme-escape-hatches rule landed in Marcode's renamed plugin dir with t3code/ rule ids in its test renamed ids, registered the rule in vite.config.ts at upstream's "error" level; vp lint apps/mobile/src is clean
Upstream's new bootstrap tests carried t3code/bootstrap-refName into server.test.ts, where Marcode had renamed every sibling to marcode/ normalized
New apps/web/src/connection/clientMetadata.ts shipped user-visible "T3 Code Desktop" / "T3 Code Web" connection labels rebranded; platform.ts now delegates to the helper so the fork keeps upstream's device/OS/browser detection
(caught by CI) Upstream's environment-published-themes test seeds localStorage with t3code:theme, but Marcode renamed the selected-theme key to marcode:theme in useTheme.ts. With no stored selection, nothing the suite published resolved and every assertion read back the default appearance — 4 failures seeded the key Marcode reads. The feature itself is unaffected: useEnvironmentTheme.ts resolves through useTheme rather than touching localStorage, so only the fixture was wrong
(caught by CI) Migrations.test.ts pins the registry tail via a fixed slice(-10) window; appending the renumbered 043/044 pushed ProjectWorkspaceLayout out of it added the entries and anchored the assertion at id 33. The window was self-defeating — each upstream migration shifted it forward by one, so it would eventually have stopped asserting the migration-33 pin the test exists for, silently

Android adaptive launcher icon (upstream pingdotgg#4332)

Upstream's fix is real — a universal export used as an adaptive foreground makes Android draw a rounded square inside the launcher mask — but its new asset is the T3 wordmark. Took the fix, derived the foreground from Marcode's own mark: apps/mobile/assets/android-icon-foreground.png is android-icon-mark.png scaled into Android's 264px adaptive safe zone by the new scripts/android-adaptive-foreground.ts. Dropped upstream's wordmark SVG, rewrote the assets/README.md section it added, kept Marcode's per-variant androidAdaptiveBackgroundColor values.

Marcode surfaces upstream still ships

  • components/files/{FileBrowserPanel,FilePreviewPanel}.tsx stay deleted, and ChatView keeps no right-panel file/files branch — the floating editor is Marcode's only file-editing surface. ChatMarkdown keeps openFileInFloatingEditor and drops upstream's useRightPanelStore import.
  • sidebar/SidebarChrome.tsx stays Marcode's bare Electron drag strip. Upstream's only change here (fix(web): add back button to project settings pingdotgg/t3code#8168) adds a footer Back button for project settings; FloatingPillNav is always present in Marcode, so there is no page to get stuck on.
  • T3Wordmark.tsx stays deleted; CompactBrandTitle and HomeHeader keep MarcodeMark. CompactBrandTitle does adopt upstream's Uniwind class refactor (which also removes a useThemeColor escape hatch the new lint rule would flag) while keeping Marcode's conditional stage pill — Marcode's production stage label is empty, so an unguarded pill would ship blank.
  • ThreadTerminalDrawer.tsx keeps Marcode's xterm link provider. Upstream's fix(web): make terminal links appear clickable only when clickable pingdotgg/t3code#7488 fix lands via the shared isTerminalUrl predicate in terminal-links.ts, which Marcode's collectMatches already applies.

Renumbered and combined

  • Migrations: upstream's 042_ProjectionThreadLinkedPullRequest and 043_ProjectionThreadsUnsettledAt become Marcode's 043 and 044 (033_ProjectWorkspaceLayout offsets the shared registry by one). Migration test toMigrationInclusive ids updated to match.
  • Capabilities: workspaceLayoutMutations and threadPullRequestLinking both kept, in contracts and ServerEnvironment plus tests.
  • bootService: launchd plist gets upstream's PATH export and keeps Marcode's MARCODE_HOME key; both the new PATH test and Marcode's MARCODE_HOME regression test run against the new render signature.
  • Composer: ChatView adopts upstream's ComposerSurface.Shell/Host (its closing tags merged cleanly) and passes Marcode's transparency through the single chat-composer-glass-shell-transparent class, which only lowers --glass-opacity.
  • KeybindingsSettings adopts upstream's extracted WarningTooltipIcon / BrowserKeybindingNotice with Marcode's copy. OpenInPicker keeps Marcode's FolderOpenFilled and drops the inline label upstream moved into editorLabelForPlatform. useHandleNewThread keeps Marcode's workspace placement and adopts upstream's resolveModelSelectionOverride. Dropped a duplicate handleNewThread upstream added above Marcode's existing declaration.
  • Storage keys and schemes stay Marcode's (composer drafts, provider-update dismissals, marcode: CSP scheme); composer draft storage takes upstream's version bump to 9. Mobile dev scripts take upstream's --clear split (dev:client:reset) on Marcode's marcode-* schemes.
  • threadSidebarWidth.test.ts: upstream deleted the file as trivial layout coverage and un-exported THREAD_SIDEBAR_DEFAULT_WIDTH. Kept only the two assertions Marcode depends on, including the pin that the sidebar header carries no brand.
  • pnpm-lock.yaml regenerated with pnpm against the merged package.json set. Neither coupled subtree needs syncing: the effect catalog version is unchanged and infra/relay/package.json is untouched (only Clerk and Expo moved).

Why

Scheduled daily upstream sync. The delta had conflicts, so the bot pushed nothing and filed #64; this is the hand-resolved integration branch that runbook calls for.

UI Changes

No screenshots — this ran headless with no browser. Three areas need a runtime pass before this leaves draft:

  1. Chat composer — now renders through upstream's ComposerSurface instead of Marcode's inline glass shell. Worth checking the draft hero and the context strip at 390px and 820px.
  2. Android launcher icon — the regenerated foreground is verified programmatically (432×432, transparent, mark inside the 264px safe zone) but not on a device.
  3. Mobile home headerCompactBrandTitle moved to Uniwind classes; confirm the stage pill still hides in production builds.

Reviewed but deliberately left alone

  • New upstream user-visible strings that say "T3 Code" (microphonePermission, theme-file error, OpenCode adapter errors) match the existing unbranded convention in those same files — app.config.ts already ships "T3 Code Dev" and pair.ts already says "No running T3 Code server found." Rebranding just the new ones would be inconsistent, and AGENTS.md says not to mass-replace internal T3 identifiers.
  • New WSL runtime cache uses $HOME/.t3/wsl-runtime inside the distro (upstream fix(desktop): Cache Runtime locally on WSL Filesystem, dramatically improving launch times  pingdotgg/t3code#5769). Self-consistent and functional, but inconsistent with Marcode's ~/.marcode home — your call whether to rename.
  • Adopting ComposerSurface leaves most of Marcode's .chat-composer-* block in index.css dead (only -transparent and -horizontal-inset are still referenced). Left in place rather than pruning ~470 lines of CSS I cannot visually verify here; worth a follow-up.
  • The .chat-timeline-scroll-fade / .settings-page-scroll-fade / .pull-requests-scroll-fade block was already dead before this merge and now also references --topbar-scroll-fade-height, which upstream renamed. Pre-existing, flagged not fixed.
  • Compatibility identifiers confirmed still upstream-shaped: T3_BOOT_SERVICE_UNIT, T3_SERVICE_LAUNCHER_CONTEXT, @t3tools/*, the t3 package/CLI name, com.t3tools.t3code.service. WORKTREE_BRANCH_PREFIX is still marcode; BOOT_SERVICE_NAME still yields marcode.service.

Checklist

  • This PR is small and focused — one concern: the upstream merge
  • I explained what changed and why
  • I included before/after screenshots for any UI changes — headless run; see UI Changes
  • I included a video for animation/interaction changes — not applicable

Verification

Typecheck clean: contracts, shared, client-runtime, web, server, desktop, mobile, scripts. vp lint clean apart from the documented no-native-title-tooltip warn seam. vp fmt --check clean.

Full suites run locally after the fixes: web 3283/3283, client-runtime 790/790, contracts all green, persistence 21/21 files.

Six tests fail in this container but pass in CI, all for the same reason — the container runs as root, so the chmod-based guards they rely on cannot fire (verified directly: it writes into a 0o555 directory). Four in theme.test.ts, one in server.test.ts, one in update-release-package-versions.test.ts. Separately, packages/shared/src/Net.test.ts fails here on port allocation; I proved it pre-existing by running the byte-identical file at main (133f3f73) in a throwaway worktree, where it fails the same way. CI passes all of these.

t3dotgg and others added 30 commits August 24, 2026 12:42
Co-authored-by: mweinbach <maxweinbach5@gmail.com>
…gg#7140)

Co-authored-by: Dara Adedeji <daraaded@amazon.com>
Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
t3dotgg and others added 24 commits August 30, 2026 13:35
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
…text (pingdotgg#8804)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius@mac.lan>
…gg#8734)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <jmarminge@gmail.com>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Merges 129 upstream commits (f035a0f..9b2d043) into Marcode. 39 paths
conflicted; each was resolved by combining both intents rather than taking a
side. Decisions, grouped by kind:

Fork-boundary breaks that merged cleanly (no conflict marker, would have
shipped broken):

- apps/server/src/cli/theme.ts — upstream's new `t3 theme` command read
  T3CODE_HOME. Every other Marcode CLI command reads MARCODE_HOME, so
  `MARCODE_HOME=... t3 theme set` would have silently targeted the default
  install. Renamed the var (and its test).
- oxlint-disable comments in apps/desktop/src/preload.ts,
  apps/desktop/scripts/verify-preload-bundle.mjs, and
  apps/server/src/process/externalLauncher.test.ts named
  `t3code/no-global-process-runtime`. Marcode's plugin meta name is `marcode`,
  so the disables were inert against a rule configured at "error". Renamed.
- oxlint-plugin-t3code/rules/no-mobile-uniwind-theme-escape-hatches.{ts,test.ts}
  landed in Marcode's renamed plugin directory; the test asserted `t3code/`
  rule ids. Renamed to `marcode/`, registered the rule in vite.config.ts at
  upstream's "error" level (lint is clean on apps/mobile/src).
- apps/server/src/server.test.ts — upstream's new bootstrap tests carried
  `t3code/bootstrap-refName` fixtures into a file where Marcode had renamed
  every sibling to `marcode/`. Normalized.
- apps/web/src/connection/clientMetadata.ts — new upstream helper shipped
  user-visible "T3 Code Desktop" / "T3 Code Web" connection labels. Rebranded;
  platform.ts now delegates to it instead of building metadata inline, so the
  fork keeps upstream's device/OS/browser detection.

Android adaptive launcher icon (upstream pingdotgg#4332):

Upstream's fix is real — a universal export used as an adaptive foreground
makes Android draw a rounded square inside the launcher mask — but its new
asset is the T3 wordmark. Took the fix and derived the foreground from
Marcode's own mark instead: apps/mobile/assets/android-icon-foreground.png is
android-icon-mark.png scaled into Android's 264px adaptive safe zone by the new
scripts/android-adaptive-foreground.ts. Dropped upstream's wordmark SVG,
rewrote the assets/README.md section it added, and kept Marcode's per-variant
androidAdaptiveBackgroundColor values.

Marcode surfaces upstream still ships:

- apps/web/src/components/files/{FileBrowserPanel,FilePreviewPanel}.tsx stay
  deleted, and ChatView keeps no right-panel `file`/`files` branch: the
  floating editor is Marcode's only file-editing surface. ChatMarkdown keeps
  openFileInFloatingEditor and drops upstream's useRightPanelStore import.
- apps/web/src/components/sidebar/SidebarChrome.tsx stays Marcode's bare
  Electron drag strip. Upstream's only change here (pingdotgg#8168) adds a footer Back
  button for project settings; Marcode's FloatingPillNav is always present, so
  there is no page to get stuck on.
- apps/mobile/src/components/T3Wordmark.tsx stays deleted; CompactBrandTitle
  and HomeHeader keep MarcodeMark. CompactBrandTitle does adopt upstream's
  Uniwind class refactor (which also removes a useThemeColor escape hatch the
  new lint rule would flag) while keeping Marcode's conditional stage pill —
  Marcode's production stage label is empty, so the pill must stay guarded.
- apps/web/src/components/ThreadTerminalDrawer.tsx keeps Marcode's xterm link
  provider. Upstream's pingdotgg#7488 fix (only treat real URLs as clickable) lands via
  the shared isTerminalUrl predicate in terminal-links.ts, which Marcode's
  collectMatches already applies.

Renumbered and combined:

- Migrations: upstream's 042_ProjectionThreadLinkedPullRequest and
  043_ProjectionThreadsUnsettledAt become Marcode's 043 and 044, since
  033_ProjectWorkspaceLayout already offsets the shared registry by one.
  Updated the migration test's toMigrationInclusive ids to match.
- Capability flags workspaceLayoutMutations and threadPullRequestLinking both
  kept, in contracts and ServerEnvironment plus their tests.
- bootService: launchd plist gets upstream's PATH export and keeps Marcode's
  MARCODE_HOME key; both the PATH test and Marcode's MARCODE_HOME regression
  test now run against the new render signature.
- Composer: ChatView adopts upstream's ComposerSurface.Shell/Host (its closing
  tags merged in cleanly) and passes Marcode's transparency through the single
  chat-composer-glass-shell-transparent class, which only lowers --glass-opacity.
- KeybindingsSettings adopts upstream's extracted WarningTooltipIcon and
  BrowserKeybindingNotice with Marcode's copy.
- OpenInPicker keeps Marcode's FolderOpenFilled icon and drops the inline
  label upstream moved into editorLabelForPlatform.
- useHandleNewThread keeps Marcode's workspace placement and adopts upstream's
  resolveModelSelectionOverride, which subsumes the carried-selection branch.
- ChatView: dropped the duplicate handleNewThread upstream added above
  Marcode's existing declaration, kept useThreadActions.
- Storage keys and schemes stay Marcode's (composer drafts, provider-update
  dismissals, marcode: CSP scheme); composer draft storage takes upstream's
  version bump to 9.
- Mobile dev scripts take upstream's --clear split (dev:client:reset) on
  Marcode's marcode-* schemes.
- threadSidebarWidth.test.ts: upstream deleted the file as trivial layout
  coverage and un-exported THREAD_SIDEBAR_DEFAULT_WIDTH. Kept only the two
  assertions Marcode depends on, including the pin that the sidebar header
  carries no brand.
- pnpm-lock.yaml regenerated with pnpm against the merged package.json set.
  Neither coupled subtree needs syncing: the effect catalog version is
  unchanged and infra/relay/package.json is untouched (only Clerk and Expo
  moved).

Verified: typecheck clean for contracts, shared, client-runtime, web, server,
desktop, mobile, and scripts; oxlint clean (only the documented
no-native-title-tooltip warn seam); focused tests pass for bootService,
ServerEnvironment, theme, serviceLauncher, migrations, settings, environment,
ElectronProtocol, clientMetadata, mobileBranding, threadSidebarWidth,
Sidebar.logic, KeybindingsSettings.logic, composerDraftStore, MessagesTimeline,
ChatMarkdown, markdown-links, terminal-links, editor-surface,
build-desktop-artifact, the oxlint rule suite, and the upstream-sync suites.
server.test.ts passes 138/139 and theme.test.ts 21/25; the five failures are
all chmod-based permission tests that a root container cannot exercise
(verified: this container writes into a 0o555 directory).
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Aug 31, 2026
…ling window

Test Server 2 failed on the sync merge: Migrations.test.ts asserts the
registry tail, and appending upstream's renumbered 043/044 pushed
ProjectWorkspaceLayout out of its fixed `slice(-10)` window.

Added the two new entries, and anchored the assertion at id 33 rather than a
trailing slice. The window was self-defeating: each upstream migration shifted
it forward by one, so it would eventually have stopped asserting the migration
33 pin the test exists for, without ever failing.
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.4 KiB 13.3 KiB −160 B (−1.2%) 15.1 KiB
Codex Thread snapshot wire 6.9 KiB 6.9 KiB +4 B (+0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.5 KiB 6.4 KiB −164 B (−2.5%) 7.8 KiB
Codex Live turn WebSocket decoded 55.0 KiB 55.5 KiB +514 B (+0.9%) 66.4 KiB
Codex Live turn messages 16 9 −7 (−43.8%) 21
Claude Total thread wire 13.4 KiB 13.3 KiB −154 B (−1.1%) 15.1 KiB
Claude Thread snapshot wire 6.9 KiB 6.9 KiB +10 B (+0.1%) 7.3 KiB
Claude Live turn WebSocket wire 6.6 KiB 6.4 KiB −164 B (−2.4%) 7.8 KiB
Claude Live turn WebSocket decoded 55.8 KiB 56.4 KiB +532 B (+0.9%) 66.4 KiB
Claude Live turn messages 16 9 −7 (−43.8%) 21

Baseline: 133f3f7 · PR result: ea8a717 · Source CI: success

Scenario 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: 109.4 KiB
  • Claude decoded thread snapshot: 110.1 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Upstream's environment-published-themes feature (pingdotgg#8569) is new in this sync, so
its test merged in with no conflict. It seeds localStorage with `t3code:theme`,
but Marcode renamed the selected-theme key to `marcode:theme` in useTheme.ts
while leaving the auxiliary theme keys upstream-shaped.

With no stored selection to find, nothing the suite published was ever resolved
and every assertion read back the default appearance — four failures in the Test
job. Seeded the key Marcode actually reads, and marked the seam.

The feature itself is unaffected: useEnvironmentTheme.ts resolves through
useTheme rather than touching localStorage, so only the fixture was wrong.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 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.