Skip to content

chore: merge upstream pingdotgg/t3code - #159

Merged
andrewcai8 merged 43 commits into
mainfrom
sync/upstream-1004
Oct 4, 2026
Merged

andrewcai8 merged 43 commits into
mainfrom
sync/upstream-1004

Conversation

@andrewcai8

Copy link
Copy Markdown
Owner

Brings the fork up to date with 42 upstream commits through 88744f3. This is a true merge commit, like the previous syncs.

What came in

Fork code deleted as superseded

  • The fork's Mermaid renderer (MarkdownMermaidBlock.tsx, lib/mermaidRendering.ts, their tests) and the mermaid@12 dependency. Upstream's chat/MermaidDiagram.tsx with mermaid@11 replaces it. Cloud chats render through the same ChatMarkdown path, so they get upstream's diagrams.
  • The fork's "Mermaid diagrams" section in docs/user/composer.md, which described the deleted renderer.

Conflicts resolved

  • packages/contracts/src/rpc.ts. ...EnvironmentControlRpcs stays in WsRpcGroup, now under upstream's .middleware(RpcScopeAuthorization). Their scopes still come from ENVIRONMENT_CONTROL_REQUIRED_SCOPES.
  • apps/server/src/ws.ts. Upstream's resolveEditorConfig, keeping the fork's rule that a cloud-only host has no Scratch root.
  • apps/server/src/usage/UsageService.ts. Upstream's scanKey(input, settings) keyed by the fork's hourly window cap. Upstream's model aliases plus the fork's Cursor history and box usage imports.
  • apps/web/src/components/ChatView.tsx. Upstream's No-project machine switching and compact-before-send. The fork's Run-on targets, cloud.onEnvironmentPicked, held cloud sends, and reconnect-on-send are layered on top.
  • apps/web/src/components/ChatMarkdown.tsx, apps/web/package.json. Upstream wins (Mermaid).
  • apps/mobile/.../ThreadArrangementSheet.tsx. Import union.
  • third-party-licenses.config.json, pnpm-lock.yaml. Upstream's file plus the fork's Namespace and Connect entries. The lockfile was regenerated from upstream's.

Follow-up fixes from the merge

  • Upstream removed addTotals and added optional per-bucket cost fields. boxUsage.ts now carries categoryCostUsd, fastCostUsd, ultrafastCostUsd, and speedPremiumUsd through the box fold, with a test.
  • Upstream made EnvironmentOption.projectId nullable. A cloud chat redirect and the next-draft target skip a machine whose No-project folder does not exist yet.

Verification

  • Typecheck passes for t3, @t3tools/web, @t3tools/mobile, @t3tools/desktop, @t3tools/client-runtime, @t3tools/contracts, and @t3tools/shared.
  • Server: src/usage, src/environmentControl, RpcAuthorization tests, and ws.test.ts pass (59 files, 859 tests).
  • Web: src/cloud, ChatMarkdown, and ChatView.logic tests pass (18 files, 243 tests).
  • client-runtime: registry.cloud.test.ts and src/cloud pass (6 files, 120 tests). Mobile thread list tests pass.
  • No live E2B or Namespace smoke in this PR.

🤖 Generated with Claude Code

t3dotgg and others added 30 commits October 3, 2026 01:43
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…gg#15101)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…waiting (pingdotgg#15114)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…dotgg#15060)

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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s, or conflicts need them (pingdotgg#15057)

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

Co-authored-by: yashranaway <yashranaway@users.noreply.github.com>
Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com>
…lt (pingdotgg#15194)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…g#14896)

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

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
…ge histories (pingdotgg#15149)

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

Chat stays centered while the workspace card fits beside it with 32px to spare. When it does not fit, chat moves left only as far as needed, narrows only after it reaches the left padding, and the card becomes a popover below a 640px chat. The card is lighter: 280px wide, 32px rows, no section labels, no "Project folder" hint.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…gdotgg#15330)

Takes over pingdotgg#14876.

Co-authored-by: tris203 <admin@snappeh.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ngdotgg#15333)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… you (pingdotgg#15346)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
yordis and others added 13 commits October 3, 2026 17:16
…otgg#15009)

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…itch (pingdotgg#15355)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…own (pingdotgg#15388)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: maria-rcks <maria@kuuro.net>
…dotgg#15334)

Co-authored-by: scratchyone <11479077+scratchyone@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Brings in 42 upstream commits. Upstream's Mermaid rendering replaces the
fork's; the fork's renderer, its tests, and its user doc section are removed.

Conflicts kept upstream's code and re-applied the fork's hooks: the
environmentControl RPCs join the scope-checked RPC group, a cloud-only host
still hides Scratch, box usage reads stay on the new usage scan key, and
the chat view keeps Run-on targets, held cloud sends, and reconnect-on-send
on top of upstream's No-project machine switching and compact-before-send.

Box usage now carries upstream's cost-by-category and speed fields, and
cloud chat redirects skip a machine whose No-project folder is not created.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. labels Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 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 4.9 KiB 4.9 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.7 KiB 3.7 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.4 KiB 20.4 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 4.9 KiB 4.9 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.7 KiB 3.7 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 20.8 KiB 20.8 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: 6fcfe4b · PR result: df43386 · 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: 106.1 KiB
  • Claude decoded thread snapshot: 106.4 KiB

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

@andrewcai8

Copy link
Copy Markdown
Owner Author

Independent verification: PASS+NOTES

Verified head df4338646bb8e071d4398b10e83cc1747eca3aeb against base 6fcfe4be8e. The verifier did not write this code. Nothing was merged or deployed. The only contact with the live host was a read-only VACUUM INTO snapshot, and its temp files were deleted afterwards.

1. Protocol. ORCHESTRATION_PROTOCOL_VERSION is 2 on both base and head (packages/contracts/src/environment.ts:13). Running boxes are not stranded. The contract changes are additive optional fields only (usageModelAliases, threadPullRequestWatch, PR watch). The stored chat-card thread shell schema is unchanged.

2. Host DB. I took a live statev2.sqlite snapshot (sha256 2a073ae3…, matches the container) and started the PR server on it in a fresh temp home with no cloud credentials. The PR adds no migrations. Results:

  • Server healthy, still alive after 8s, descriptor protocol 2.
  • Upstream ledger 1-56 and fork ledger 1-5, unchanged.
  • Leases 195/195, chat cards 22/22 (all 22 carry a V2 thread title), provision operations 238, projects 3, auth sessions 8, box_usage 119 and 3308 hours.
  • Lease and card content digests identical before and after.
  • settings.json byte-identical, with 29 provider instances.
  • The main build on the same copy gives the identical result. Each build logs the same 3 error lines, caused by provisioning/*.json files I deliberately did not copy.

3. Live smokes. These ran on a local manager built from the head as a cloud-only host (T3CODE_LOCAL_AGENT_RUNS=false, no CLAUDE* env).

  • E2B, claudeAgent,codex, provision/turns/resume/delete: 45/46 pass. 0 checks differ from the last V2 baseline (v2head-smoke-e2b). The only failure is host.skills.codex, which also fails on main (config).
  • Namespace, run with the smoke's default agents: 46/49 pass. On the claudeAgent and codex checks, 0 differ from v2head-smoke-ns-2. Pause, resume, reconnect and the post-resume turn all pass, as do all 4 delete checks.

4. RPC scope middleware on fork RPCs, live.

  • Read-only bearer (orchestration:read): environmentControl.list and listProvisioned succeed. stop and dispose are rejected with EnvironmentAuthorizationError (requiredScope: orchestration:operate).
  • Full bearer: stop reaches the handler and returns refused/unknown. The smokes ran provision, claim, pause, resume and dispose through the middleware.
  • RpcAuthorization and boxUsage server tests pass, 3 files and 22 tests.

Mermaid. In the built web bundle, the ChatMarkdown chunk lazy-imports mermaid@11.17.2 core. I rendered that exact chunk in headless Chromium with MermaidDiagram's initialize options. It produced an <svg> with 3 nodes and all 4 labels, and a syntax error was rejected. ChatMarkdown.test.tsx passes 51/51.

Notes (not blockers)

  • The Namespace run included cursor because I used the default agents. turn.cursor.provider and account.cursor failed because the manager logged Provisioning without cursor: no account is usable. That is the known V2 Cursor sign-in step and the same on main. It is not from this PR.
  • scripts/cloud/local-manager.sh start does not set T3CODE_LOCAL_AGENT_RUNS=false. With local agent runs on, the host hides provisionedSkills, so host.skills.* fail as a harness artifact (smoke-e2b-localagents.json). That earlier run's provision, turns, resume and delete checks all passed.

Cleanup

I created 3 boxes (E2B ircrv2jbt5kaqm8g3i31y and if97d26tfx26zsvnzhq98, Namespace t9mhui6q82uje), and all 3 were disposed through the manager. Managers were stopped by spawned PID (60844, 72132). Afterwards nsc list shows only the user's pre-existing qdt1o044i1beo, and none of my E2B sandboxes remain.

Evidence: /Users/andrew/.t3/worktrees/verify-159/.t3/verify/runs/ (hostdb-pr.json, hostdb-main.json, smoke-e2b.json, smoke-ns.json, scope-probe.json, mermaid-render.json, test logs). Tools: .t3/verify/tools/ (check-host-db.sh, fetch-host-file.sh, verify159-probe-scopes.tmp.ts, mermaid-render.mjs, e2b-list.mjs).

@andrewcai8
andrewcai8 merged commit cd66e76 into main Oct 4, 2026
25 checks passed
@andrewcai8
andrewcai8 deleted the sync/upstream-1004 branch October 4, 2026 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. 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.