Skip to content

merge: upstream through f4c394323 — Sidebar v2, glass redesign, Auto runtime mode - #45

Merged
DanielGGordon merged 219 commits into
mainfrom
t3code/upstream-sync-2026-07-27
Jul 27, 2026
Merged

merge: upstream through f4c394323 — Sidebar v2, glass redesign, Auto runtime mode#45
DanielGGordon merged 219 commits into
mainfrom
t3code/upstream-sync-2026-07-27

Conversation

@DanielGGordon

Copy link
Copy Markdown
Owner

Merges 79 new upstream commits since the 6f34ad3e8 cut point. Three commits: an ancestry graft, the resolved merge, and docs.

⚠️ Merge this with "Create a merge commit" — not squash

Squash-merging PR #42 is what caused most of the work in this PR. It discards the second parent, so git stopped believing upstream was an ancestor and merge-base fell back to 2026-07-07. Measured cost: 76 conflicted files / 238 hunks instead of 18 / 40, plus an inflated 208-commit delta when only 79 were new.

Commit 7c1b9f62a repairs it by re-merging PR #42's original merge commit (still on GitHub as origin/t3code/upstream-sidebar-change). Its diff is empty — it only restores provenance. Squashing this PR throws that away again. A rule is now in AGENTS.md.

After merging, please verify: git merge-base origin/main upstream/main should print f4c394323, not dad088976.

Blocker resolved: migration ledger

Upstream shipped 033_ProjectionThreadsSettled + 034_ProjectionThreadsSnoozed. This fork already owns id 33, recorded in production's ledger since 2026-07-09. Effect's Migrator skips any id <= the recorded max with no name comparison, so renumbering ours upward would mean upstream's 33 never runs, the settled columns are never created, and the auto-merged ProjectionThreads.ts queries fail on every thread read — a full outage that CI and every fresh-DB test-deploy pass green.

Resolution: we keep 33; upstream's two are renumbered to 034/035. Zero DB surgery. Every future sync re-applies the offset until the ensureForkSchema follow-up lands.

Owner decisions applied

Decision Applied
Migrations Fork keeps 33, upstream offset to 034/035
Auto runtime mode Merged but gated behind Settings → Features (default off)
Merge method Documented rule; land this via merge commit or ff-push
Color schemes Culled to Solarized only
Sidebar All fork sidebar work dropped except the CPU/memory readout

Sidebar

Only the host-stats readout survives, and it moved into the shared sidebar/SidebarChrome.tsx — so it now renders in both v1 and the v2 beta, where it was previously v1-only. Upstream's extraction had no host-stats slot, so taking their side would have silently deleted the mount.

Dropped: sidebarChatListView, boxed project cards, the restart-request sidebar pill. The restart-request feature itself is untouched — only its sidebar affordance is gone. Sidebar v2 ships default OFF.

Things git would not have flagged

  • ClaudeAdapter.ts auto-merged with no conflict, so our case "claude-opus-5": return 1_000_000 hack survived and would have silently overridden upstream's new 200k/1M contextWindow descriptor. Deleted explicitly. PR feat(claude): add Claude Opus 5 to built-in models #44 is retired for upstream's 41a430a88, which is a strict superset — ours reused Fable 5's 2.1.169 gate instead of Opus 5's 2.1.219, and advertised 1M while sending 200k.
  • index.css: both sides of the one conflict are +1 brace depth sharing a } past the marker. Naive union does not build. Second time this trap has appeared.
  • Upstream's [data-sidebar-version] block hard-codes ten generic color tokens and applies even with the beta off. Element-scoped properties beat :root[data-scheme], so it would have killed Solarized inside the whole sidebar. Stripped to the --sidebar-* family.
  • ProviderCommandReactor: taking upstream's side broke 7 deferred-recycle tests. Upstream added an eager threadModelSelections write at turn start; the fork's deferred model-change recycle compares against that map, so the eager write makes every pending recycle look already applied. Upstream's pendingTurnStart flag kept, the write dropped.

Merged but gated / must-not-run

  • t3 service install/uninstall must never run on the deploy host — it hard-codes t3code.service and would overwrite the hand-written production unit. A reference copy is now committed at deploy/t3code.service.
  • Server self-update audited as inert here (capability is null under systemd, and prod runs a source checkout).
  • State-directory resolution is unchanged for production t3 serve — verified against deriveServerPaths/resolveBaseDir. No DB-orphaning risk.

Verification

  • tsgo --noEmit clean: contracts, client-runtime, server, web, desktop
  • @t3tools/web build passes (the check that catches the CSS trap)
  • 5724 tests pass. Remaining failures reproduce on origin/main and are not from this merge: 17 desktop suites (Electron binary absent on this headless host) and server.test.ts > preserves structured workspace rpc failures.

Follow-ups (not in this PR)

  1. ensureForkSchema seam — closes the migration-offset hole permanently, including a stock-created DB recording 33 as upstream's migration. Must account for t3-claude-import.timer running a second migrating process against the same DB.
  2. scripts/test-deploy-lib.ts pins PRUNE_SCHEMA_VERSION = 32 while prod is at 33 — the default curated seed has been silently falling back since 2026-07-09.
  3. Cull useComposerProjectSkills (upstream now probes skills server-side); give ProjectionThread.requestingRestart a decoding default.

Rollback procedure: docs/operations/rollback-2026-07-27-sync.md. The one-way door is Auto runtime mode — hence the gate.

🤖 Generated with Claude Code

juliusmarminge and others added 30 commits July 7, 2026 22:49
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…gg#3781)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
…pingdotgg#3795)

Co-authored-by: Julius Marminge <julius@mac.lan>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
…tgg#3823)

Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Horus Lugo <horusgoul@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Shivam Sharma <91240327+shivamhwp@users.noreply.github.com>
Co-authored-by: Ben Davis <45952064+bmdavis419@users.noreply.github.com>
Co-authored-by: Alex <me@pixp.cc>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius@mac.lan>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
t3dotgg and others added 24 commits July 23, 2026 18:38
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…otgg#4414)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…tgg#4413)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: maria <maria@kuuro.net>
…g#4450)

Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Theo Browne <me@t3.gg>
…dotgg#4488)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ingdotgg#4555)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…otgg#4556)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…tgg#4397)

Co-authored-by: codex <codex@users.noreply.github.com>
PR #42 was squash-merged (8dc98e8 has one parent, committer GitHub <noreply@github.com>), so origin/main carries the merged CONTENT of the 2026-07-23 true merge but not its second parent 6f34ad3. Re-merging the original merge commit d963ff7 leaves the tree byte-identical and moves merge-base(main, upstream/main) from dad0889 (2026-07-07) to 6f34ad3 (2026-07-21), cutting the follow-up merge from 76 conflicted files to 18.
…sign, Auto runtime mode

Merges 80 new upstream commits since the 6f34ad3 cut point. 18 files
conflicted; full rationale in UPSTREAM_DIVERGENCE.md.

Owner decisions applied:
- Migrations: this fork keeps id 33 (ProjectionThreadRestartRequest, already
  recorded in prod's ledger). Upstream's 033_ProjectionThreadsSettled and
  034_ProjectionThreadsSnoozed are renumbered to 034/035. Effect's Migrator
  skips any id <= the recorded max WITHOUT comparing names, so reusing 33
  would silently never create the settled columns on the production DB.
- Sidebar: no fork sidebar work preserved except the host CPU/memory readout,
  which moved into the shared sidebar/SidebarChrome.tsx so it now renders in
  both sidebar v1 and the v2 beta. Dropped: sidebarChatListView (grouped/flat),
  boxed project cards, the restart-request sidebar pill and its test. The
  restart-request feature itself (server detection, chat surfacing, migration
  033) is untouched.
- Color schemes culled to Solarized only; upstream's glass redesign added a
  token family every scheme must re-declare. Upstream's [data-sidebar-version]
  block had its ten generic tokens stripped (they are element-scoped and would
  defeat app theming inside the whole sidebar subtree); only --sidebar-* is
  kept, and Solarized now declares that family itself.
- Sidebar v2 ships default OFF (upstream's own default).

Fork PR #44's Claude Opus 5 entry is retired for upstream's 41a430a, which
is a strict superset: a 200k/1M contextWindow descriptor and a dedicated
2.1.219 gate. The fork reused Fable 5's 2.1.169 gate and advertised 1M while
sending 200k. Removed with it: the claude-opus-5 case in
selectedClaudeContextWindow (ClaudeAdapter.ts) which would have silently
overridden upstream's descriptor -- that file auto-merged without a conflict.

Also retired: connectionStatusHeadline for upstream's connectionStatusTitle.

Kept against upstream: showsHorizontalScrollIndicator={false} on
MessagesTimeline (guards a left-edge text-selection bug LegendList
reintroduces; no test covers it), and the omission of the eager
threadModelSelections write at turn start in ProviderCommandReactor -- the
fork's deferred model-change recycle compares against that map, so upstream's
eager write makes every pending recycle look already applied. Taking upstream
there broke 7 deferred-recycle tests.

Verified: tsgo --noEmit clean on contracts, client-runtime, server, web,
desktop; @t3tools/web build passes; 5724 tests pass. Remaining failures are
pre-existing and reproduce on origin/main: 17 desktop suites (Electron binary
not installed on this headless host) and server.test.ts "preserves structured
workspace rpc failures".
…unit

- UPSTREAM_DIVERGENCE.md: dated 2026-07-27 entry covering the ancestry repair,
  the migration-33 offset and its stock-DB hole, what was retired in favour of
  upstream, what was deliberately kept, the sidebar cull, the theme cull and the
  stripped [data-sidebar-version] tokens, and what shipped gated vs must-never-run.
- AGENTS.md: sync PRs land as merge commits or ff-push. Never squash, never
  rebase-merge, never `git revert -m 1`. Includes the measured 4x conflict cost
  and the repair procedure.
- docs/operations/rollback-2026-07-27-sync.md: pre-deploy backup (whole userdata,
  not just the DB), the import-timer stop, post-deploy ledger assertions, and the
  Auto-runtime-mode one-way door with its recovery UPDATE.
- deploy/t3code.service: reference copy of the production unit, which upstream's
  new `t3 service install` would otherwise overwrite unannounced.

Also gates upstream's "Auto" runtime mode behind a Features per-device toggle
(composerAutoRuntimeModeVisible, default off) in both composer pickers. A thread
already set to Auto still lists the option so the select cannot render blank.
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Jul 27, 2026
…ledger

Adds 034_035_ForkMigrationOffset.test.ts, which runs migrations to 33 (the
production ledger's actual high-water mark), then runs the rest and asserts the
tail reads 33/34/35 with the right names and that all six columns exist --
requesting_restart, restart_request_reason, settled_override, settled_at,
snoozed_until, snoozed_at.

A fresh-database test cannot catch this class of bug: it replays every migration
from zero. The regression only appears when the ledger already carries a maximum,
because Effect's Migrator run loop is purely ordinal and never compares names.
Verified the test has teeth by temporarily renumbering the fork's migration up to
35 and upstream's back to 33/34 -- it fails on that arrangement and passes on
this one.

Also unblocks the default test-deploy seed: scripts/test-deploy-lib.ts pinned
PRUNE_SCHEMA_VERSION at 32 while prod reached 33 on 2026-07-09, so
test-seed-refresh has been hard-refusing to rebuild the curated template for 18
days and every test-deploy since silently fell back. Bumped to 35 with its three
coupled assertions. Confirmed migrations 33/34/35 are ALTER-only, so the
PER_THREAD_TABLES prune list needs no change.
@DanielGGordon

Copy link
Copy Markdown
Owner Author

Test deployment

Slot: external 7446 ⇄ loopback 3776. Branch t3code/upstream-sync-2026-07-27, seeded with the curated template.

External URL verified reachable (HTTP 200). Pairing links are one-time and expire in ~1h — mint a fresh one with:

node scripts/test-status.ts --pair 7446 --base-url https://<SERVER_IP>:7446

Migration rehearsal — the point of this deploy

The curated seed template was stale (built 2026-07-09, ledger max 32) because PRUNE_SCHEMA_VERSION was pinned at 32 while prod reached 33. That is fixed in this PR, and the template was republished from prod at schema 33 — so this slot reproduces production's actual migration high-water mark rather than a fresh database.

Result after boot:

35 | ProjectionThreadsSnoozed
34 | ProjectionThreadsSettled
33 | ProjectionThreadRestartRequest

All six columns present: requesting_restart, restart_request_reason, settled_override, settled_at, snoozed_until, snoozed_at.

This is the exact scenario that would have failed silently had the fork's migration been renumbered upward instead of upstream's. It is also covered permanently by 034_035_ForkMigrationOffset.test.ts, which was negative-tested: it fails when the numbering is inverted and passes on this arrangement.

Seed safety

Verified before boot — the template's projection_projects.workspace_root is uniformly the curated sandbox, and 0 threads carry a worktree_path. No agent can spawn in a real repo from this slot.

Note on the deploy script output

test-deploy.ts printed the degraded/tunnel-mode banner, but that is a false negative: it probes https://127.0.0.1:<port>, where TLS SNI does not match Caddy's cert. Both the pool slot and prod's 7443 return 200 on the public interface. Worth fixing in the test-deploy follow-up.

What to look at

  • Sidebar renders in v1 (upstream default) with your CPU/memory readout in the footer — it now lives in the shared chrome, so it should also appear if you flip Settings → Beta → Sidebar v2.
  • Settings → Features → Auto runtime mode is off; the composer's access picker should show only Supervised / Auto-accept edits / Full access until you enable it.
  • Settings → Appearance: Color scheme now offers Default and Solarized only. Check the sidebar is themed in Solarized rather than falling back to upstream's zinc.

@DanielGGordon
DanielGGordon merged commit 0458fa2 into main Jul 27, 2026
6 of 10 checks passed
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.