Skip to content

chore(fork): sync upstream through 337c5858c3 - #123

Open
jamesainslie wants to merge 4 commits into
mainfrom
lathe/sync-latest-upstream
Open

jamesainslie wants to merge 4 commits into
mainfrom
lathe/sync-latest-upstream

Conversation

@jamesainslie

Copy link
Copy Markdown
Owner

Syncs the fork with upstream through 337c5858c3. That is 377 upstream commits since 47f2c8d29e, merged through the upstream-lathe mirror as docs/internals/fork-upstream-sync.md describes. Merge this with a merge commit, never a squash, or the mirror parent is lost.

Commits

  • 32b2d8d141 Rename rules. Classifies the names upstream added: the installer's relative-home variables ($t3_home, t3_cwd), the MCP evals' t3.filter local and T3SECRET placeholder. Also includes two rules added after the merge: upstream hosts written as escaped regexes (preview\.t3\.codes) stay as they are, and a "t3" thread id fixture that the same test also writes inside a kept app.t3.codes link stays too.
  • 59146b3a06 Mirror. Upstream's tree at 337c5858c3 run through the codemod and vp fmt, with the lockfile regenerated. Already pushed to upstream-lathe.
  • 56a8bfbfec Merge. Conflicts in 49 files, resolved by keeping each fork feature on upstream's new structure. The fixes below are in the same commit, because the merge alone does not build.

Fixes after the merge

  • Effect 4.1.2. effect/Crypto is gone. Fork code now uses SecureRandom and Digest the way upstream does. Typecheck now applies Effect's rules as errors, so fork code was updated to match: errors become Schema.TaggedError, env reads go through HostProcess.Environment, and tryPromise gets a typed catch.
  • Usage limits. Upstream reads cliproxy management keys from a secret provider. The fork's Iris modelproxy source keeps its kept routes, retries and live status stream, and only cliproxy keys go through the secret provider.
  • Antigravity sign-in. Upstream's fix (fix(server): Antigravity sign-in no longer blames the network while the runtime starts pingdotgg/t3code#30079) starts the "no response" hint after the runtime initializes. The fork's sign-in flow (AuthRelayFlow) now has a ready signal that Antigravity sends after initialize(). Claude and Codex sign-in are unchanged.
  • Mobile sidebar. Upstream moved the sidebar into WorkspaceThreadSidebar.tsx. The fork's "Depends on", "Start a thread to unblock this" and "Continue in new thread" actions moved with it. The dependency picker screen uses AppBar, since upstream now restricts AndroidScreenHeader.
  • Managed policy. Upstream's new templates hard-coded com.t3tools.t3code. They now use FORK_IDENTITY.appId, so the generated macOS profile governs Lathe.
  • Test fixtures. Upstream tests now use the fork's identity values: port 4773, the t3code-fork systemd unit, the lathe launcher, the lathe:// scheme. Fork test mocks gained the services and exports that upstream's new code reaches.
  • Agent context budget. Re-measured.
  • CI. ci-fork mirrors upstream's ASCII filter on the shared Test job, which works around the runner's trace writer crashing on surrogate pairs.

Decision: thread links stay Lathe's

Upstream now makes thread Copy produce https://app.t3.codes/threads/... links, and gives outside MCP clients the same links. app.t3.codes opens upstream's hosted app and hands off to T3 Code, not Lathe. So, as James decided:

  • Copy keeps writing Lathe's own references, as before.
  • Outside MCP clients keep getting a link on the server origin they reached, as before.
  • Hosted links others paste still parse and open in Lathe.

One switch, LATHE_COPIES_HOSTED_THREAD_LINKS in packages/shared/src/forkThreadLinks.ts, turns on upstream's behaviour once Lathe has a hosted app of its own (#71).

Verification

Run locally on the branch:

  • Every package typechecks. vp lint and vp fmt are clean on the changed files, and vp run knip:check passes.
  • node scripts/fork-rename-codemod.ts reports 0 renames.
  • The tests in every file upstream added or changed in the range (485 files, including mobile and web browser tests), run per package, plus the full packages/shared and scripts suites. Failures remain only where upstream fails the same way on this host: GitVcsDriver sparse checkpoints, GitManager "includes CLAUDE.md ..." (the global gitignore), and knip-schemas.test.ts and cached-tests.test.ts, which hit the 5s timeout on the plain upstream tree too.

The full suites were not run locally. CI runs them.

Worth a look

  • iOS thread row menu. Upstream moved secondary row actions under a "More" submenu on iOS (fix(mobile): keep iOS thread menus short enough for drag selection pingdotgg/t3code#30944). The fork's Highlight, title and auto-settle items follow that rule. The order on Android is unchanged.
  • MCP tool crashes. Under upstream's in-process MCP middleware, a crash in a thread-history tool now reaches the agent as a JSON-RPC InternalError instead of ending the request.
  • Settled failures. Upstream's failureEdgeAt change means a failed run with no completedAt no longer counts from updatedAt. The fork's dependency logic in threadRaisedHandSince shares that helper, so it behaves the same way.

Opus 5.5 in Claude Code, run from Lathe.

Upstream's tree at this commit, run through scripts/fork-rename-codemod.ts and
vp fmt, with the lockfile regenerated.

Upstream: 337c585
Upstream 337c585 adds relative-home handling to install.sh ($t3_home,
t3_cwd) and a T3SECRET placeholder and t3.filter local in the MCP evals.
Brings the fork up to upstream 337c585 (377 commits) through the
renamed mirror, with the fork code that upstream's refactors broke fixed
in the same commit so every commit builds:

- effect/Crypto is gone in Effect 4.1.2; fork code uses SecureRandom and
  Digest, and fork errors are Schema.TaggedError per upstream's rules.
- Antigravity's no-response hint starts once the runtime is ready
  (upstream pingdotgg#30079), through a ready signal in AuthRelayFlow.
- Lathe keeps writing its own thread references on Copy, and outside MCP
  clients keep getting links on the server origin they reached, instead
  of upstream's app.t3.codes links. One fork switch,
  LATHE_COPIES_HOSTED_THREAD_LINKS, flips this once Lathe has a hosted
  app (#71). Hosted links still parse and open in Lathe.
- Managed-policy templates use the fork's app id.
- The mobile sidebar keeps the fork's dependency and continue actions
  after upstream moved it into WorkspaceThreadSidebar.
- ci-fork mirrors upstream's ASCII filter on the shared Test job.
Upstream's star prompt now imports canvas-confetti dynamically. CI's
heavy browser step runs ChatView in its own Vite server, which found the
dependency mid-run, re-optimized and reloaded, so ChatView failed to
import.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant