chore(upstream): sync marcode through 2c4158f8 - #47
Draft
maarco wants to merge 95 commits into
Draft
Conversation
…in GitHubPullRequestCli (pingdotgg#7385) Signed-off-by: aoright <102943475+aoright@users.noreply.github.com>
Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: maria <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: maria <254055478+maria-rcks@users.noreply.github.com>
…pingdotgg#7459) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…t full speed (pingdotgg#7460) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…nt (pingdotgg#6563) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…ngdotgg#7477) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…tgg#6286) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: GPT-5.6 <noreply@openai.com>
Co-authored-by: GPT-5.6 <noreply@openai.com>
…otgg#7286) Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
…pingdotgg#7283) Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: maria <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: maria <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: GPT-5.6 <noreply@openai.com>
…otgg#7809) Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
…gdotgg#7794) Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: maria <254055478+maria-rcks@users.noreply.github.com>
…tgg#6633) Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
…pingdotgg#7774) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Brings 92 upstream commits (82b8a93..2c4158f) into Marcode. 25 paths conflicted; each was resolved by combining upstream's intent with Marcode's, never by taking a whole file from one side. Fork-boundary breaks that merged cleanly (no conflict, silent regressions): - bootService: upstream's new macOS launch agent (pingdotgg#6286) exported T3CODE_HOME into the plist. The Marcode launcher reads MARCODE_HOME and exits without it, so the background service would never have started. Renamed, and pinned with a test asserting the plist names MARCODE_HOME and never T3CODE_HOME. - bootService: the launch-agent label is now derived from BOOT_SERVICE_NAME (com.t3tools.marcode.service), matching the reason Marcode already renamed the systemd unit -- an upstream install writes com.t3tools.t3code.service.plist to the same path and the two must not overwrite each other. Pinned with a test. - bootService test: upstream's new uninstall assertion hardcoded "systemctl --user disable --now t3code.service"; it now reads BOOT_SERVICE_UNIT_FILE so it cannot drift from Marcode's unit name again. - cli/triage: upstream's new `t3 triage` command (pingdotgg#6563) resolves its base dir from T3CODE_HOME while its own comment claims parity with `t3 pair`, which reads MARCODE_HOME. Switched to MARCODE_HOME. - ci.yml: upstream moved every job to Blacksmith runners (pingdotgg#7286, pingdotgg#7283). A blacksmith-* label matches no runner on this fork, so those jobs would queue forever rather than fail. All CI jobs are back on GitHub-hosted runners, and the existing runner-pinning test now also rejects any blacksmith label. - ChatView: upstream's background-draft promotion (pingdotgg#7821) landed without its `const handleNewThread = useNewThreadHandler()` declaration, which fell in a region Marcode had diverged. Restored; the file now typechecks. - docs/user/background-service.md: the new platform section named upstream's unit paths; corrected to marcode.service and com.t3tools.marcode.service.plist. Conflict decisions: - .plans/**: took upstream's removal (pingdotgg#7665). Marcode's only change there was a path rebrand inside a file the repo policy already says not to commit, and .plans/ is gitignored. - apps/web/src/components/files/{FileBrowserPanel,FilePreviewPanel}.tsx: kept Marcode's deletion. Upstream's change (pingdotgg#7490) is a refresh affordance confined to the retired right-panel file surfaces and has no floating-editor analogue. The removal stays pinned by rightPanelStore.test.ts. - Migrations: upstream's 041_AuthSessionClientConnection renumbered to 042. Marcode's ProjectWorkspaceLayout owns 033, so every shared migration sits one id higher; renumbering an applied id would re-run or skip it on real installs. - cli/service.ts, cli/connect.ts: took upstream's macOS/launchd copy paths, kept Marcode's product name. - SidebarChrome: kept Marcode's footer. Upstream's SidebarUtilityMenu adds Settings, Usage, Pull Requests, and Back to a footer Marcode emptied because FloatingPillNav owns those; SidebarChrome.fork.test.tsx already pins this. - SettingsSidebarNav: same call, same reason -- upstream swapped the single Back row for SidebarUtilityMenu. Kept Marcode's Back row and added a test so the swap fails loudly instead of merging silently next time. - WorkspacePageHeader: adopted upstream's shared header primitive on settings and usage, and added a `sidebarless` prop for Marcode's SIDEBARLESS_TITLEBAR_INSET_CLASS. Those routes mount no sidebar, so upstream's collapsed-sidebar selector never matches and the header would slide back under the native window controls. - UsagePage: took upstream's redesign (pingdotgg#7147) and re-applied Marcode's styled Tooltip on both refresh controls. - _chat.pull-requests / PullRequestListFilters: took upstream's shared PullRequestRefreshControl and Button-based filter trigger, and moved Marcode's Tooltip onto them rather than keeping a third refresh button in the header. - threadSettled: retired Marcode's CHANGE_REQUEST_SETTLE_IDLE_MS warm window in favour of upstream's event-ordering rule (pingdotgg#7454). Both fix the same bug -- a merged PR burying a warm follow-up -- but upstream's also covers the inherited PR case (a thread opened on a branch whose PR already merged must never settle), which the time window would have regressed. Marcode's warm-window tests are replaced with tests for the combined rule, and the retirement is documented where the constant used to live. - ChatComposer / ComposerPendingApprovalPanel: took upstream's composer state drawers (pingdotgg#7150). Marcode's in-surface approval banner depended on a container upstream removed; the glass treatment lives on chat-composer-glass-shell in ChatView and is unaffected. - ChatView: kept Marcode's ChatHeader call and its ThreadActionsCluster portal inside upstream's WorkspacePageHeader, and kept the single container-level panelLayoutControls render so it is not drawn twice. Kept chat-composer-glass-shell-transparent and took upstream's -attached modifier. - ChatHeader: kept Marcode's title-only header. Upstream's inline rename and title action menu (pingdotgg#7817, pingdotgg#7476) duplicate entry points Marcode already provides from the sidebar row and pill nav. - RightPanelTabs: took upstream's tab mute feature (pingdotgg#7252) and surface-dropdown shortcuts (pingdotgg#7318), minus copy-path and the Files entry, which address the right-panel file surface Marcode retired. Marcode's existing add-surface menu now renders from upstream's shared action list rather than duplicating it. - ThreadTerminalDrawer: kept Marcode's terminal chrome and its FitAddon padding, took upstream's themed terminal background and routed every close through upstream's close confirmation (pingdotgg#7592). - Sidebar.tsx: kept Marcode's 12px empty-state type, took upstream's cursor-pointer fix (pingdotgg#5545). - MessagesTimeline: kept Marcode's text-sm, took upstream's -mx-1 removal. - AGENTS.md: kept Marcode's structure and its own Verifying/Pull-requests sections, adopted upstream's new "Plans and work artifacts" policy and folded its PR-assets rule into Marcode's list. - index.css, __root.tsx, Sidebar.logic.ts: additive on both sides; kept both. Coupled changes: pnpm-workspace.yaml moved only Clerk versions, not the effect catalog, so no .repos/ subtree sync is required. infra/relay/package.json is unchanged. Verified: focused tests for threadSettled, bootService, service, serviceLauncher, migration 042, upstream-sync workflow, dev-runner, Sidebar.logic, contracts settings, shared git, RightPanelTabs, SidebarChrome fork pins, threadSidebarWidth, rightPanelStore, ThreadStatusIndicators, desktopUpdate, editor-surface. Typecheck clean for web, server, contracts, shared, client-runtime, mobile, desktop. Targeted fmt --check and lint clean on the changed scope. Not verified here: tests that import @aliimam/icons fail to resolve in this container because that package declares main: dist/index.cjs and ships dist/index.js. Both the dependency and the importing files are untouched by this merge.
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
`Test Server 3` failed with `spawn rg ENOENT` on three
WorkspaceFileSystem searchContent tests. WorkspaceFileSystem calls
execFile("rg", ...), a bare PATH lookup.
Upstream never installs ripgrep -- their Blacksmith images ship it.
GitHub-hosted ubuntu-24.04 does not, so Marcode carries an install step,
and this sync converted every CI job back to GitHub-hosted runners.
pingdotgg/t3code@d7b9a689 then moved the `t3` suite into a new sharded
`test_server` job, and the Marcode-only step did not follow it there.
The existing parity test only inspected `ci.jobs.test`, so the move was
invisible to it. It now derives the job list from whatever actually runs
a Test step and asserts the install for each, so a future split, rename,
or new test job fails there instead of in CI.
Verified: WorkspaceFileSystem.test.ts passes locally with rg present
(31 tests); the broadened parity test fails with `job "test_server" must
install ripgrep` when the step is removed and passes when restored.
Both tests guard Marcode divergences the merge relocated rather than removed, so both failed on content that is actually correct. Migrations.test.ts pinned a fixed 9-entry tail. Adding upstream's AuthSessionClientConnection as 042 slid Marcode's own migration 33 out of that window, so the diff read as "33 disappeared" rather than "42 is new". It now anchors on 33 by lookup and asserts the sequence from there, which keeps the pin's intent and reports the real change next time. workspaceTitlebar.fork.test.ts scanned settings.tsx and UsagePage.tsx for a `drag-region` line next to SIDEBARLESS_TITLEBAR_INSET_CLASS. Adopting upstream's shared WorkspacePageHeader moved both out of the call sites, so neither string remained. The guarantee still has two independently regressible halves, and each is now asserted where it lives: the primitive maps `sidebarless` to the unconditional inset and carries the drag region, and both routes pass the prop. Verified: each rewritten pin fails when its regression is reintroduced (the primitive reverted to the collapsed-only inset, and a route dropping the prop) and passes when restored. Full apps/web suite green (289 files, 2961 tests).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What Changed
Merges
pingdotgg/t3code@2c4158f8into Marcode — 92 upstream commits since the last sync point (82b8a938), as one two-parent merge commit. 25 paths conflicted and were resolved by hand.This supersedes the three older stacked sync drafts (#41 through
f2d5fc91, #43 throughbeab6886, #45 throughbe7d35aa); their ranges are all contained in this one. Close them if this lands.CI is green on
480c621a— all four required checks (Check,Test,Mobile Native Static Analysis,Release Smoke) plusRust,Test Server 1/2/3. The red checks on the two earlier commits are the three failures described below, each fixed in a follow-up commit.Fork-boundary breaks that merged cleanly — no conflict, silent regressions
These are the dangerous ones. Every item below produced zero conflict markers and would have shipped broken.
T3CODE_HOMEinto the plist.resolveLauncherBaseDirreadsMARCODE_HOMEand throws without it — the background service would never start on macOS.MARCODE_HOME; pinned with a test asserting the plist names it and neverT3CODE_HOME.com.t3tools.t3code.service, so an upstream T3 Code install writes the same~/Library/LaunchAgents/…plistpath and the two overwrite each other.BOOT_SERVICE_NAME→com.t3tools.marcode.service, matching the reason Marcode already renamed the systemd unit. Pinned with a test.systemctl --user disable --now t3code.service.BOOT_SERVICE_UNIT_FILEso it can't drift from Marcode's unit name again.t3 triagecommand (pingdotgg#6563) resolves its base dir fromT3CODE_HOME, while its own comment claims parity witht3 pair— which readsMARCODE_HOME.MARCODE_HOME.blacksmith-*label matches no runner on this fork, so those jobs queue forever rather than failing.blacksmithlabel outright.test_serverjob (pingdotgg#7286), and Marcode's ripgrep install — needed only because of the runner conversion — stayed on the oldtestjob.WorkspaceFileSystemsearch tests failed withspawn rg ENOENT. Upstream never hits this; their Blacksmith images ship ripgrep.test_server. The parity test now derives the job list from whatever actually runs a test suite, so the next split or rename fails there instead of in CI.handleNewThreadbut not its declaration, which fell in a region Marcode had diverged.useNewThreadHandler();apps/webtypechecks.marcode.service/com.t3tools.marcode.service.plist.Conflict decisions
Kept Marcode, ported the upstream fix inside the hunk
SidebarChrome/SettingsSidebarNav— upstream'sSidebarUtilityMenuadds Settings, Usage, Pull Requests and Back to surfaces where FloatingPillNav already owns them.SidebarChrome.fork.test.tsxalready pinned the thread sidebar; added a matching pin for the settings footer, which had no test and would have merged silently.ChatHeader— kept Marcode's title-only header. Upstream's inline rename and title action menu (feat(web): double-click chat header title to rename thread pingdotgg/t3code#7817, feat: refine thread action menus pingdotgg/t3code#7476) duplicate entry points Marcode provides from the sidebar row and pill nav.ThreadTerminalDrawer— kept Marcode's terminal chrome and FitAddon padding; took upstream's themed terminal background and routed every close through upstream's close confirmation (feat(web): confirm before closing a terminal pingdotgg/t3code#7592).ChatView— kept the title-only header call and theThreadActionsClusterportal inside upstream'sWorkspacePageHeader; kept the single container-levelpanelLayoutControlsrender so it isn't drawn twice.Sidebar.tsx— kept Marcode's 12px empty-state type, took upstream'scursor-pointerfix (fix(web): show pointer on add project button pingdotgg/t3code#5545).files/{FileBrowserPanel,FilePreviewPanel}.tsx— kept Marcode's deletion. Upstream's fix(web): refresh open file with the file tree pingdotgg/t3code#7490 is confined to the retired right-panel file surfaces and has no floating-editor analogue.Took upstream's refactor, re-applied Marcode's behavior on top
WorkspacePageHeader— adopted upstream's shared header primitive on settings and usage, and added onesidebarlessprop forSIDEBARLESS_TITLEBAR_INSET_CLASS. Those routes mount no sidebar, so upstream's collapsed-sidebar selector never matches and the header would slide back under the native window controls.UsagePage— took the redesign (feat(web): redesign usage insights pingdotgg/t3code#7147), re-applied Marcode's styled Tooltip on both refresh controls._chat.pull-requests/PullRequestListFilters— took upstream's sharedPullRequestRefreshControland Button-based filter trigger, moved Marcode's Tooltip onto them instead of keeping a third refresh button in the header.RightPanelTabs— took tab mute (feat(desktop): mute a browser tab pingdotgg/t3code#7252) and surface-dropdown shortcuts (feat(web): add shortcuts to the surface dropdown pingdotgg/t3code#7318), minuscopy-pathand the Files entry, which address the retired right-panel file surface. Marcode's add-surface menu now renders from upstream's shared action list rather than duplicating it.ChatComposer/ComposerPendingApprovalPanel— took upstream's composer state drawers (feat(web): attach composer state drawers pingdotgg/t3code#7150); Marcode's in-surface approval banner depended on a container upstream removed. The glass treatment lives onchat-composer-glass-shellin ChatView and is unaffected.Where Marcode's implementation was superseded
threadSettled— retired Marcode'sCHANGE_REQUEST_SETTLE_IDLE_MSwarm window in favour of upstream's event-ordering rule (fix(threads): a merged PR settles its thread only once pingdotgg/t3code#7454). Both fix the same bug (a merged PR burying a warm follow-up), but upstream's also covers the inherited-PR case — a thread opened on a branch whose PR already merged must never settle — which the time window would have regressed. Marcode's warm-window tests are replaced with tests for the combined rule, and the retirement is documented where the constant lived.Other
Migrations— upstream's041_AuthSessionClientConnectionrenumbered to 042. Marcode'sProjectWorkspaceLayoutowns 033, so every shared migration sits one id higher; renumbering an applied id would re-run or skip it on real installs..plans/**— took upstream's removal (chore: move implementation plans out of repository pingdotgg/t3code#7665). Marcode's only change there was a path rebrand inside a file the repo policy already says not to commit, and.plans/is gitignored.AGENTS.md— kept Marcode's structure and its own Verifying / Pull-requests sections; adopted upstream's new "Plans and work artifacts" policy and folded its PR-assets rule into Marcode's list.cli/service.ts,cli/connect.ts— took upstream's macOS/launchd copy paths, kept Marcode's product name.index.css,__root.tsx,Sidebar.logic.ts— additive on both sides; kept both.Coupled changes:
pnpm-workspace.yamlmoved only Clerk versions, not theeffectcatalog, so no.repos/subtree sync is required.infra/relay/package.jsonis unchanged.Two fork pins this sync relocated
Both guard Marcode divergences the merge moved rather than removed, so both failed CI on content that is actually correct. Rewritten to assert the invariant where it now lives:
Migrations.test.tspinned a fixed 9-entry tail, so adding migration 42 slid Marcode's own migration 33 out of the window — the diff read as "33 disappeared" rather than "42 is new". Now anchors on 33 by lookup.workspaceTitlebar.fork.test.tsscanned settings/usage for adrag-regionline besideSIDEBARLESS_TITLEBAR_INSET_CLASS; adoptingWorkspacePageHeadermoved both out of the call sites. The guarantee still has two independently regressible halves, each now asserted where it lives.Why
The daily sync had stalled behind three unmerged drafts, so the fork was 92 commits behind and drifting. Merging the full range in one reviewed pass is cheaper than resolving three overlapping stacks, and it re-establishes a single merge base for the next run.
Every fix above is either an upstream correctness/security/operational change Marcode needs, or a Marcode product contract that upstream's rewrite would have quietly removed. Hotspot paths were treated as mandatory-review, not as automatic keep-Marcode.
UI Changes
Not captured — this ran headless with no browser or display available. This is the main reason the PR is still draft. The following surfaces changed and want a look:
sidebarlessinset matters (the header must clear the traffic lights).Checklist
Verification
CI green on
480c621a:Check,Test,Mobile Native Static Analysis,Release Smoke,Rust,Test Server 1/2/3,Mobile Native Changes. Thread-transfer bot reports the merge stays within every enforced ceiling (+6.7% total wire against a 15.1 KiB cap).Locally:
apps/webfully green (289 files, 2961 tests); typecheck clean for web, server, contracts, shared, client-runtime, mobile, desktop;fmt --checkandlintclean on the changed scope.Each rewritten pin was verified to still fail on the regression it guards — the ripgrep step removed from
test_server, the header primitive reverted to the collapsed-only inset, and a route dropping thesidebarlessprop — and to pass when restored.Known-noisy locally, green in CI
The sync container is resource-constrained and shares its port space, which produced local-only failures that CI does not reproduce. Treat CI as authoritative for these:
packages/shared/src/Net.test.ts→findAvailablePort returns preferred when it is free. BothNet.tsandNet.test.tsare byte-identical to pre-mergemain, and the test passes in CI.GrokAdapterdrain-window test hit its 120s timeout locally under a concurrently running suite. All three CI server shards pass.Not verified here
Worth a maintainer decision
t3 triage's playbook still points atpingdotgg/t3code— a Marcode user running it would be told to file issues upstream. Left as-is: that's a product decision, not a merge decision.docs/internals/scripts.mdstill documentsT3CODE_HOMEand.t3/userdata. Pre-existing drift, not caused by this merge; left alone to keep the diff focused.Mobile Native Static Analysisis now conditionally skipped (upstream ci: only boot the macOS native lint runner when native sources change pingdotgg/t3code#7283 gates it on native source changes) and is a required check. It ran on this PR because the diff touches native sources, so the skip path is unverified — worth confirming branch protection treats a skipped required check as passing.