Skip to content

Fork cannot follow upstream #553

Closed
Closed

Description

@github-actions

Fork cannot follow upstream

Plan: The plan did not finish. Run: https://github.com/scuttletoby/t3code/actions/runs/44628922635

Rebasing the series from v0.1.11-nightly.20261118.4890 onto v0.1.11-nightly.20261119.4954 stopped at: 63e3de2 feat(web): file links open remotely, full size, download from their menu (#17)

Conflicting files:

apps/web/src/components/ChatMarkdown.tsx

What git said:

Auto-merging apps/web/src/components/ChatMarkdown.tsx
CONFLICT (content): Merge conflict in apps/web/src/components/ChatMarkdown.tsx
error: could not apply 63e3de290f... feat(web): file links open remotely, full size, download from their menu (#17)
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Could not apply 63e3de290f... # feat(web): file links open remotely, full size, download from their menu (#17)

The series was left as it is. To follow by hand: git fetch https://github.com/pingdotgg/t3code.git tag v0.1.11-nightly.20261119.4954,
git rebase --onto v0.1.11-nightly.20261119.4954 v0.1.11-nightly.20261118.4890 <series branch>, resolve, run the tests, then push the branch with
--force-with-lease, and start the follow workflow once (gh workflow run fork-follow.yml --repo scuttletoby/t3code):
it releases the series and disables the upstream workflows that push started.

What State now
Series branch main at df35246da0ff
Candidate branch fork-follow/candidate absent
Backups of earlier series (tags) fork-follow/pre-v0.1.11-nightly.20261118.4890-1974264545d5
Release none: the plan did not pick a commit

Activity

  1. scuttletoby commented on Nov 20, 2026

    @scuttletoby
    Owner

    Hand rebase onto v0.1.11-nightly.20261119.4954: candidate fork-follow/candidate = 4b09b5ed24ffd754b2c978d398d2a3dc3a52cf42

    main at df35246da0ff was rebased with git rebase --onto v0.1.11-nightly.20261119.4954 v0.1.11-nightly.20261118.4890 (the workflow's fork identity, --empty=drop). The result is 270 commits, and the seam and schema checks pass. Only the candidate branch was pushed: main is unchanged and no fork-follow run or release was started.

    Note: since df35246, main has gained one commit, f49745fab2 (#554). It is not in the candidate and has to go on top when main moves.

    Range-diff

    git range-diff v0.1.11-nightly.20261118.4890..df35246da0ff v0.1.11-nightly.20261119.4954..4b09b5ed24: 259 =, 11 !, nothing added or dropped.

    commit why it changed
    #17, #89, #426 conflicts, resolved below
    #73, #89, #91, #313, #540 extra fixes: fork code or tests that upstream's new changes broke, folded into the commit that introduced them (below)
    #5, #174, #384, #528, #540 context only: upstream's new lines show in the patch context; the fork's patch is unchanged

    Conflicts (each keeps upstream's change and the fork's feature)

    1. feat(web): file links open remotely, full size, download from their menu #17 file links, apps/web/src/components/ChatMarkdown.tsx: the import block only. Between the tags, upstream reworked this file:

      • openFileInPanel now uses the right-panel host and the user-action revision (markUserAction/getUserActionRevision) instead of the basename-lookup claim, so a file the user opens in the meantime wins.
      • It added issue-link previews.
      • It added chatMarkdownImageSource/shouldRenderMarkdownImageAsFileLink.

      The resolution keeps upstream's new scopedThreadKey import next to the fork's resolveAssetUrl. The fork's full-size open still calls upstream's openFileInPanel and then setMaximized, which is an automatic update and does not bump the user-action revision, so the two stay compatible.

    2. feat(slots): agent slot gate on delegate_task (off by default) #89 slot gate and fork seams: green from upstream on main; a PR's own list is format-checked (#385) #426 seams, apps/server/src/mcp/OrchestratorMcpService.ts: upstream (c0b1d32) gave resolveTargetRechecking a cwd input (parentWorkspaceCwd(parent)) so workspace models resolve against the parent's workspace. Both resolutions keep the fork's block (the slot gate, then the scoped delegateTask) and add upstream's cwd: yield* parentWorkspaceCwd(parent), to it. Each resolved patch equals the fork's patch plus that one line.

    Extra fixes (upstream changes that broke fork code or tests)

    Tests (under heavy)

    • typecheck (all packages): ok. The server typecheck was run again on the final candidate: ok.
    • lint: ok (warnings only).
    • Web tests touching ChatMarkdown: unit 18/18, browser 69/69.
    • .github/fork-ci-tests.txt (fork-ci-tests.cjs): ok, 86 groups.
    • Full apps/server suite: the waits and hold-work failures are fixed. Those test files now pass (179/179 in src/waits/ + holdWork.boot). What still fails also fails the same way on old main df35246 on this machine: local Node is 24, but the repo pins Node 26:
      • ServerBrowser (8): Uint8Array.fromBase64.
      • ProjectionStore (1) and Orchestrator.control-reads (1 on old main, 2 on the candidate): sqlite statement.stat. The extra control-reads test fails with the same missing Node 26 API.
    • The waits and hold-work boot tests are not in .github/fork-ci-tests.txt, so fork CI would not have caught those two breaks.
    Range-diff of the 11 changed commits
     10:  63e3de290f !  10:  3d79ff63ab feat(web): file links open remotely, full size, download from their menu (#17)
        @@ apps/web/src/components/ChatMarkdown.permissions.browser.test.tsx: it("preserves
         
          ## apps/web/src/components/ChatMarkdown.tsx ##
         @@ apps/web/src/components/ChatMarkdown.tsx: import {
        -   isAtomCommandInterrupted,
            squashAtomCommandFailure,
          } from "@t3tools/client-runtime/state/runtime";
        + import { scopedThreadKey } from "@t3tools/client-runtime/environment";
         +import { resolveAssetUrl } from "@t3tools/client-runtime/state/assets";
          import type {
            CodexArtifactTemplate,
        @@ apps/web/src/components/ChatMarkdown.tsx: function useChatMarkdownState({
            const remoteOpen = useRemoteOpenResolution(environmentId);
            const canUseShellActions =
         @@ apps/web/src/components/ChatMarkdown.tsx: function useChatMarkdownState({
        -   const projects = useProjects();
        +     ).data ?? undefined;
            const [preferredEditor] = usePreferredEditor(availableEditors);
            const preferredEditorMenuLabel = openInEditorMenuLabel(preferredEditor, messages);
         +  const forkRemoteEditor = useForkMarkdownFileRemoteEditor(remoteOpen.state, cwd, messages); // Fork
        @@ apps/web/src/components/ChatMarkdown.tsx: function useChatMarkdownState({
         +  };
            const openFileInPanel = (fileLinkMeta: MarkdownFileLinkMeta, panelPath: string) => {
              if (!threadRef) return;
        -     // Every open supersedes pending lookups, including synchronous opens.
        +     const openAt = (path: string) =>
         @@ apps/web/src/components/ChatMarkdown.tsx: function useChatMarkdownState({
                    markdownFileCopyPaths(fileLinkMeta, await resolveHostPath(), cwd)
                  }
     28:  8e5fb49516 !  28:  ce9e2c4518 Auto-update (server): background service updates itself when quiet (#5)
        @@ apps/server/src/orchestration-v2/runtimeLayer.test.ts: import * as Effect from "
          import * as Option from "effect/Option";
         +import * as FileSystem from "effect/FileSystem";
          import * as Path from "effect/Path";
        + import * as PubSub from "effect/PubSub";
          import * as Queue from "effect/Queue";
        - import * as Ref from "effect/Ref";
         @@ apps/server/src/orchestration-v2/runtimeLayer.test.ts: import * as PullRequestService from "../pullRequest/PullRequestService.ts";
          import * as ProjectStore from "./ProjectStore.ts";
          import * as ProviderSessionManager from "./ProviderSessionManager.ts";
     39:  5533a6ef19 !  39:  86cada2a26 feat(usage): usage pacing gate on delegate_task (pacing part 4) (#73)
        @@ apps/server/src/mcp/OrchestratorMcpService.ts: const make = Effect.gen(function*
                  parent,
                  target: input.target,
                  providers,
        +         cwd: yield* parentWorkspaceCwd(parent),
                  skipProjectEnablementFilter: isRetryOfAcceptedDelegation,
                });
         +      // Fork: a request that is invalid anyway fails now, not after a usage hold of hours. The pacer moves a task only
        @@ apps/server/src/mcp/OrchestratorMcpService.usageGate.test.ts (new)
         +            } as unknown as ProviderAdapter.ProviderAdapterV2["Service"]),
         +        }),
         +      ),
        -+      Layer.mock(ProjectService.ProjectService)({}),
        ++      Layer.mock(ProjectService.ProjectService)({ getById: () => Effect.succeedNone }),
         +      Layer.mock(SecretRequests.SecretRequests)({}),
         +      Layer.mock(RemoteDelegation.RemoteDelegation)({}),
         +      Layer.mock(ScheduledTaskService.ScheduledTaskService)({}),
        @@ apps/server/src/mcp/OrchestratorMcpService.usageGate.test.ts (new)
         
          ## apps/server/src/server.ts ##
         @@ apps/server/src/server.ts: const layerMakeRoutes = Layer.mergeAll(
        -     Layer.provide(ProviderAdapterRegistry.layerFromProviderInstanceRegistry),
              Layer.provide(McpOAuth.layerMcpClientAuthenticator),
        +     Layer.provide(ProjectionStoreV2.layer),
            ),
         +  // Fork: /mcp reads the usage pacer only if it is there (the usage pacing gate). Asking for it
         +  // here, beside /mcp, makes a server wired without it a type error instead of a silent gate.
     42:  4bc4145e48 !  42:  1313eabfd7 feat(slots): agent slot gate on delegate_task (off by default) (#89)
        @@ apps/server/src/mcp/OrchestratorMcpService.slotGate.test.ts (new)
         +          }),
         +        ),
         +    }),
        -+    Layer.mock(ProjectService.ProjectService)({}),
        ++    Layer.mock(ProjectService.ProjectService)({ getById: () => Effect.succeedNone }),
         +    Layer.mock(SecretRequests.SecretRequests)({}),
         +    Layer.mock(RemoteDelegation.RemoteDelegation)({}),
         +    Layer.mock(ScheduledTaskService.ScheduledTaskService)({}),
        @@ apps/server/src/mcp/OrchestratorMcpService.ts: const make = Effect.gen(function*
         +          parent,
         +          target: input.target,
         +          providers,
        ++          cwd: yield* parentWorkspaceCwd(parent),
         +          skipProjectEnablementFilter: isRetryOfAcceptedDelegation,
         +        });
         +        // Fork: a request that is invalid anyway fails now, not after a usage hold of hours. The pacer moves a task only
        @@ apps/server/src/mcp/OrchestratorMcpService.ts: const make = Effect.gen(function*
         -        parent,
         -        target: input.target,
         -        providers,
        +-        cwd: yield* parentWorkspaceCwd(parent),
         -        skipProjectEnablementFilter: isRetryOfAcceptedDelegation,
         -      });
         -      // Fork: a request that is invalid anyway fails now, not after a usage hold of hours. The pacer moves a task only
        @@ apps/server/src/server.ts: const layerRuntimeCoreDependenciesBase = Layer.mergeA
            layerProviderInstallationRefresh,
            ProviderInstallation.layer,
         @@ apps/server/src/server.ts: const layerMakeRoutes = Layer.mergeAll(
        -     Layer.provide(ProviderAdapterRegistry.layerFromProviderInstanceRegistry),
              Layer.provide(McpOAuth.layerMcpClientAuthenticator),
        +     Layer.provide(ProjectionStoreV2.layer),
            ),
         -  // Fork: /mcp reads the usage pacer only if it is there (the usage pacing gate). Asking for it
         -  // here, beside /mcp, makes a server wired without it a type error instead of a silent gate.
     48:  441886a5da !  48:  2123acc521 feat(waits): delivery and scheduling (part 3, off by default) (#91)
        @@ apps/server/src/waits/WaitService.testkit.ts (new)
         +export const memoryFileSystem = () => {
         +  const files = new Map<string, string>();
         +  const missing = FileSystem.makeNoop({});
        ++  const decoder = new TextDecoder();
         +  let temps = 0;
        ++  // A handle opened to write starts the file empty; each write appends; sync has nothing to flush.
        ++  const handle = (path: string, writable: boolean) => {
        ++    if (writable) files.set(path, "");
        ++    const append = (buffer: Uint8Array) =>
        ++      Effect.sync(() => void files.set(path, (files.get(path) ?? "") + decoder.decode(buffer)));
        ++    return {
        ++      [FileSystem.FileTypeId]: FileSystem.FileTypeId,
        ++      sync: Effect.void,
        ++      writeAll: append,
        ++      write: (buffer: Uint8Array) => Effect.as(append(buffer), buffer.length),
        ++    } as unknown as FileSystem.File;
        ++  };
         +  const fs = FileSystem.makeNoop({
         +    exists: (path) => Effect.succeed(files.has(path)),
        ++    // Atomic saves write through one handle, keep the replaced file's mode and sync the directory.
        ++    open: (path, options) => Effect.succeed(handle(path, options?.flag?.startsWith("w") ?? false)),
        ++    chmod: () => Effect.void,
        ++    stat: (path) =>
        ++      files.has(path)
        ++        ? Effect.succeed({ type: "File", mode: 0o600 } as FileSystem.File.Info)
        ++        : missing.stat(path),
         +    readFileString: (path) => {
         +      const contents = files.get(path);
         +      return contents === undefined ? missing.readFileString(path) : Effect.succeed(contents);
     63:  2832e95bc4 !  63:  cc3989fd06 fork: delegate checks behind one fork module (SEAM) (#174)
        @@ apps/server/src/mcp/OrchestratorMcpService.ts: const make = Effect.gen(function*
            const requestKey = (clientRequestId: string | undefined): Effect.Effect<string> =>
              clientRequestId === undefined ? random.uuidV4() : Effect.succeed(clientRequestId);
         @@ apps/server/src/mcp/OrchestratorMcpService.ts: const make = Effect.gen(function* () {
        -           providers,
        +           cwd: yield* parentWorkspaceCwd(parent),
                    skipProjectEnablementFilter: isRetryOfAcceptedDelegation,
                  });
         -        // Fork: a request that is invalid anyway fails now, not after a usage hold of hours. The pacer moves a task only
        @@ apps/server/src/mcp/OrchestratorMcpService.ts: const make = Effect.gen(function*
                          target:
                            committedThread === null
         @@ apps/server/src/mcp/OrchestratorMcpService.ts: const make = Effect.gen(function* () {
        -                 providers,
        +                 cwd,
                          skipProjectEnablementFilter: isRetryOfAcceptedCreation,
                        });
         +              // Fork: the seat of the fork's delegation checks for created threads (may change the target).
    155:  ed07eb27bd ! 155:  78e6773cea hold-work: a held server does not start T3 Connect; tests for every hold (#190) (#313)
        @@ apps/server/src/cloud/CloudLink.ts: export class CloudLink extends Context.Servi
          ## apps/server/src/cloud/holdWorkConnect.test.ts (new) ##
         @@
         +import * as NodeServices from "@effect/platform-node/NodeServices";
        -+import { EnvironmentAuthenticatedPrincipal, ThreadId } from "@t3tools/contracts";
        ++import { ThreadId } from "@t3tools/contracts";
         +import { describe, expect, it } from "@effect/vitest";
         +import * as Cause from "effect/Cause";
         +import * as Effect from "effect/Effect";
        @@ apps/server/src/cloud/holdWorkConnect.test.ts (new)
         +      expect(yield* cloudLink.releaseManagedTunnelOnShutdown()).toBe(false);
         +      // A client's request to link or change the link: refused, with the reason.
         +      const refused = yield* Effect.all([
        -+        Effect.flip(cloudLink.linkProof(undefined as never, undefined as never)),
        ++        Effect.flip(cloudLink.linkProof(undefined as never)),
         +        Effect.flip(cloudLink.applyRelayConfig(undefined as never)),
         +        Effect.flip(cloudLink.updatePreferences(undefined as never)),
        ++        Effect.flip(cloudLink.updateLiveActivityPreference(true)),
         +        Effect.flip(cloudLink.answerHealthRequest(undefined as never)),
         +        Effect.flip(cloudLink.mintCredential(undefined as never)),
        -+      ]).pipe(Effect.provideService(EnvironmentAuthenticatedPrincipal, undefined as never));
        ++      ]);
         +      for (const error of refused) {
         +        expect(error).toEqual(HoldWorkConnect.heldConnectRefusal());
         +        expect(error.message).toContain("--hold-work");
        @@ apps/server/src/cloud/holdWorkConnect.ts (new)
         +    linkProof: refuse,
         +    applyRelayConfig: refuse,
         +    updatePreferences: refuse,
        ++    // Sets the relay's live-activity preference for the environment id a copy shares.
        ++    updateLiveActivityPreference: refuse,
         +    answerHealthRequest: refuse,
         +    mintCredential: refuse,
         +    reconcileDesiredLinkIfStillDesired: Effect.fn("HoldWorkConnect.reconcileDesiredLink")(() =>
        @@ apps/server/src/holdWork.boot.test.ts
         +import * as NodeCrypto from "node:crypto";
         +import * as NodeEvents from "node:events";
          import * as NodeFS from "node:fs";
        -+import * as NodeHttp from "node:http";
        ++import * as NodeHttps from "node:https";
          import * as NodeNet from "node:net";
          import * as NodeOS from "node:os";
          import * as NodePath from "node:path";
        @@ apps/server/src/holdWork.boot.test.ts: const freePort = () =>
         +  readonly close: () => Promise<void>;
         +}
         +
        ++// The fake serves https with the localhost test certificate, which the booted servers trust:
        ++// T3 Connect sends a link's token only to its configured https relay.
        ++const REMOTE_CERT = NodeURL.fileURLToPath(
        ++  new URL("./peer/fixtures/localhost-cert.pem", import.meta.url),
        ++);
        ++const REMOTE_KEY = NodeURL.fileURLToPath(
        ++  new URL("./peer/fixtures/localhost-key.pem", import.meta.url),
        ++);
        ++
         +const fakeRemote = () =>
         +  new Promise<FakeRemote>((resolve, reject) => {
         +    const requests: FakeRemote["requests"] = [];
        -+    const server = NodeHttp.createServer((request, response) => {
        ++    const tls = { cert: NodeFS.readFileSync(REMOTE_CERT), key: NodeFS.readFileSync(REMOTE_KEY) };
        ++    const server = NodeHttps.createServer(tls, (request, response) => {
         +      let body = "";
         +      request.on("data", (chunk: Buffer) => (body += chunk.toString("utf8")));
         +      request.on("end", () => {
        @@ apps/server/src/holdWork.boot.test.ts: const freePort = () =>
         +      const address = server.address();
         +      if (typeof address !== "object" || address === null) return reject(new Error("no port"));
         +      resolve({
        -+        url: `http://127.0.0.1:${address.port}`,
        ++        url: `https://127.0.0.1:${address.port}`,
         +        requests,
         +        close: () =>
         +          new Promise<void>((done) => {
        @@ apps/server/src/holdWork.boot.test.ts: const boot = async (root: string, extraAr
         +        T3CODE_TELEMETRY_ENABLED: "true",
         +        T3CODE_POSTHOG_HOST: remote.url,
         +        // A build with T3 Connect: startup then also reconciles the stored desired link. The
        -+        // address never resolves; the stored link points at the local fake server.
        -+        T3CODE_RELAY_URL: "https://relay.invalid",
        ++        // build's relay is the local fake server the stored link points at, so a held boot that
        ++        // reached it would show there.
        ++        T3CODE_RELAY_URL: remote.url,
        ++        NODE_EXTRA_CA_CERTS: REMOTE_CERT,
         +        T3CODE_CLERK_PUBLISHABLE_KEY: "pk_test_hold_work",
         +        T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: "client-hold-work",
                  NO_COLOR: "1",
    175:  fbcc9bbcb2 ! 175:  67641152f8 server: fork service layers in one fork file (server.ts fork lines down); handoff contract files are fork files (#384)
        @@ apps/server/src/server.ts: const layerRuntimeCoreDependenciesBase = Layer.mergeA
            ProviderInstallation.layer,
            ReplayMarkers.layer,
         @@ apps/server/src/server.ts: const layerMakeRoutes = Layer.mergeAll(
        -     Layer.provide(ProviderAdapterRegistry.layerFromProviderInstanceRegistry),
              Layer.provide(McpOAuth.layerMcpClientAuthenticator),
        +     Layer.provide(ProjectionStoreV2.layer),
            ),
         -  // Fork: /mcp reads the usage pacer and the slot gate only if they are there (the usage pacing
         -  // gate, agentSlots). Asking for them here, beside /mcp, makes a server wired without one a type
    191:  add4b33f35 ! 191:  89f270787b fork seams: green from upstream on main; a PR's own list is format-checked (#385) (#426)
        @@ apps/server/src/mcp/OrchestratorMcpService.ts: const make = Effect.gen(function*
         -          parent,
         -          target: input.target,
         -          providers,
        +-          cwd: yield* parentWorkspaceCwd(parent),
         -          skipProjectEnablementFilter: isRetryOfAcceptedDelegation,
         +    // Fork: `Effect.scoped` closes the hold of a call that stops half-way (fork/delegateChecks.ts).
         +    delegateTask: Effect.fn("OrchestratorMcpService.delegateTask")(function* (callerScope, input) {
        @@ apps/server/src/mcp/OrchestratorMcpService.ts: const make = Effect.gen(function*
         +        parent,
         +        target: input.target,
         +        providers,
        ++        cwd: yield* parentWorkspaceCwd(parent),
         +        skipProjectEnablementFilter: isRetryOfAcceptedDelegation,
         +      });
         +      const runtimeMode = yield* resolveRuntimeMode(
        @@ apps/server/src/orchestration-v2/runtimeLayer.test.ts: import * as Effect from "
          import * as Option from "effect/Option";
         -import * as FileSystem from "effect/FileSystem";
          import * as Path from "effect/Path";
        + import * as PubSub from "effect/PubSub";
          import * as Queue from "effect/Queue";
        - import * as Ref from "effect/Ref";
         
          ## docs/fork/updates.md ##
         @@ docs/fork/updates.md: watches; it changes nothing on the machine, and `0` turns it off.
    258:  90229cf2b3 ! 258:  4d13fc51eb feat(server): Claude threads apply their MCP profile's outside servers (#528)
        @@ packages/provider-core/src/server/failure.ts: function curatedCauseMessages(caus
                  case "ClaudeMcpRegistrationTimeoutError":
         +        case "ClaudeMcpProfileError":
                  case "ClaudeCodeRootRefusalError":
        +         case "ClaudeCodeStartupExitError":
                  case "ClaudeConversationNotFoundError":
        -         case "CursorModelUnavailableError":
    262:  0757ca9f93 ! 262:  e01ba92eaf fix(remote-delegation): a reply from a linked environment on another version still completes its task (#540)
        @@ apps/server/src/fork/remoteReplyRead.test.ts (new)
         +  items: olderAnswer.items.map(({ textTruncated: _truncated, ...item }) => item),
         +};
         +
        ++/**
        ++ * An older version's thread of 250 items, read over pages: its first page has no reply, and its
        ++ * last page (after position 199) has it. Any other page is not expected.
        ++ */
        ++const olderPagedAnswer = (input: { readonly afterPosition?: number }) => {
        ++  const thread = { ...olderAnswer.thread, itemCount: 250 };
        ++  if (input.afterPosition === undefined) {
        ++    return { ...olderAnswer, thread, items: [], nextPosition: 99, hasMore: true };
        ++  }
        ++  if (input.afterPosition === 199) {
        ++    const items = olderAnswer.items.map((item) => ({ ...item, position: 249 }));
        ++    return { ...olderAnswer, thread, items, nextPosition: null, hasMore: false };
        ++  }
        ++  return { unexpectedPage: input.afterPosition };
        ++};
        ++
         +/** What the peer client does with an answer: decode it here or fail as it does. */
         +const decodeAnswer = (success: Schema.Top, answer: unknown) =>
         +  Schema.decodeUnknownEffect(success as Schema.Decoder<unknown>)(answer).pipe(
        @@ apps/server/src/fork/remoteReplyRead.test.ts (new)
         +
         +/**
         + * The delegation service following one open task on the box, whose run there has ended and
        -+ * whose thread answers `answer`. `betaOff`: this machine's linked environments are off, so a
        -+ * call (not a follower's read) is refused.
        ++ * whose thread answers `answer` (or `answer(input)` per read). `betaOff`: this machine's linked
        ++ * environments are off, so a call (not a follower's read) is refused.
         + */
         +const followTask = (answer: unknown, options: { readonly betaOff?: boolean } = {}) =>
         +  Effect.gen(function* () {
         +    const reads: Array<"read" | "reply-read"> = [];
        ++    const answerTo = (input: { readonly afterPosition?: number }) =>
        ++      typeof answer === "function" ? (answer as typeof olderPagedAnswer)(input) : answer;
         +    const completed = yield* Deferred.make<{ readonly status: string; readonly result: string }>();
         +    const task = {
         +      id: taskId,
        @@ apps/server/src/fork/remoteReplyRead.test.ts (new)
         +    const forwarding = Layer.mock(PeerForwarding.PeerForwarding)({
         +      waitForThread: () =>
         +        Effect.succeed({ threadId: childThreadId, runId, status: "completed", timedOut: false }),
        -+      readThread: () =>
        ++      readThread: ((_scope: unknown, _environmentId: unknown, input: never) =>
         +        Effect.sync(() => reads.push("read")).pipe(
        -+          Effect.andThen(decodeAnswer(OrchestratorMcpThreadReadResult, answer)),
        -+        ) as never,
        -+      call: ((_scope: unknown, tool: { readonly name: string; readonly successSchema: never }) => {
        ++          Effect.andThen(decodeAnswer(OrchestratorMcpThreadReadResult, answerTo(input))),
        ++        )) as never,
        ++      call: ((
        ++        _scope: unknown,
        ++        tool: { readonly name: string; readonly successSchema: never },
        ++        _environmentId: unknown,
        ++        input: never,
        ++      ) => {
         +        if (tool.name !== "t3_thread_read") return Effect.die(`unexpected call ${tool.name}`);
         +        if (options.betaOff) return Effect.fail(PeerForwarding.linkedEnvironmentsOff);
         +        return Effect.sync(() => reads.push("reply-read")).pipe(
        -+          Effect.andThen(decodeAnswer(tool.successSchema, answer)),
        ++          Effect.andThen(decodeAnswer(tool.successSchema, answerTo(input))),
         +        );
         +      }) as never,
         +    });
        @@ apps/server/src/fork/remoteReplyRead.test.ts (new)
         +  ),
         +);
         +
        ++it.effect("an older version's reply on its last page is read by the tail probe", () =>
        ++  Effect.scoped(
        ++    Effect.gen(function* () {
        ++      const { completion, reads } = yield* followTask(olderPagedAnswer);
        ++      assert.deepStrictEqual(completion, { status: "completed", result: reply });
        ++      // The first page and the tail page, each read again without the thread's other details.
        ++      assert.deepStrictEqual(reads, ["read", "reply-read", "read", "reply-read"]);
        ++    }),
        ++  ),
        ++);
        ++
         +it.effect.each([
         +  ["whose reply does not decode either", unreadableAnswer, {}],
         +  ["while linked environments are off here", olderAnswer, { betaOff: true }],
        @@ apps/server/src/fork/remoteReplyRead.ts (new)
         +/**
         + * Fork: a task's reply from a linked environment on another version. Its thread details may lack a
         + * field this version requires, which fails the whole read and kept the task running forever; the
        -+ * reply needs none of them. Runs and items keep their schemas, so a reply is never guessed.
        ++ * reply needs none of them but the item count. Runs and items keep their schemas, so a reply is never guessed.
         + */
         +import {
         +  OrchestratorMcpFailure,
        ++  OrchestratorMcpThreadDetail,
         +  OrchestratorMcpThreadReadInput,
         +  OrchestratorMcpThreadReadResult,
         +} from "@t3tools/contracts";
        @@ apps/server/src/fork/remoteReplyRead.ts (new)
         +
         +import type * as PeerForwarding from "../peer/PeerForwarding.ts";
         +
        -+/** A thread read without the thread's details: all a task's reply is read from. */
        -+export const ReplyPage = OrchestratorMcpThreadReadResult.mapFields(Struct.omit(["thread"]));
        ++/**
        ++ * A thread read whose thread details keep only `itemCount` (every version that answers a thread
        ++ * read has it; lastReply's tail probe pages by it): all a task's reply is read from.
        ++ */
        ++export const ReplyPage = OrchestratorMcpThreadReadResult.mapFields((fields) => ({
        ++  ...fields,
        ++  thread: OrchestratorMcpThreadDetail.mapFields(Struct.pick(["itemCount"])),
        ++}));
         +export type ReplyPage = typeof ReplyPage.Type;
         +
         +/** `t3_thread_read` there, decoding its answer as a ReplyPage. */
        @@ apps/server/src/peer/RemoteDelegation.ts: const make = Effect.gen(function* () {
             * The last reply `runId` gave on the task's thread there, which is its
             * result, read whole however long it is. A failed run prefers its error
         @@ apps/server/src/peer/RemoteDelegation.ts: const make = Effect.gen(function* () {
        -     runId: RunId | null,
              failed = false,
        +     probeSuccess = true,
            ) {
         +    const forwarding = replyForwarding; // Fork: a reply there on another version is still read.
              let reply: OrchestratorMcpThreadTimelineItem | undefined;
  2. scuttletoby commented on Nov 20, 2026

    @scuttletoby
    Owner

    Review of the rebased series

    Candidate fork-follow/candidate = 8b669dfc56 (old main f49745fab2 rebased from v0.1.11-nightly.20261118.4890 onto v0.1.11-nightly.20261119.4954, with #554 on top). This was a read-only review: I pushed nothing and changed no branch.

    Verdict: safe to move main. No BLOCKING or MAJOR findings. There are two MINOR follow-ups and one correction to the rebase report.

    What I checked myself

    • Range-diff (f49745fa vs 8b669dfc, 271 each): 260 = and 11 !, the same 11 commits the report lists. Nothing was added or dropped. golive: journal the measured handover delay; load-proof gap timing test (#534) #554 is =.

    • Tree check (the main proof). I built the three-way merge of old main and the new tag (git merge-tree --write-tree f49745fa v0.1.11-nightly.20261119.4954, base = the old tag). It had exactly one conflict, the import block of ChatMarkdown.tsx. I then diffed that merge against the candidate. The only differences are:

      1. apps/web/src/components/ChatMarkdown.tsx: the conflict resolved to both imports (scopedThreadKey from upstream and resolveAssetUrl from the fork).
      2. The listed fixes, all in fork-only files (none of them exists in the upstream tag): cloud/holdWorkConnect.ts and its test, fork/remoteReplyRead.ts and its test, holdWork.boot.test.ts, OrchestratorMcpService.{slot,usage}Gate.test.ts, waits/WaitService.testkit.ts.

      So the candidate tree = old main + upstream's full diff between the two tags + these fixes. No upstream file differs from the merge, so no upstream change was undone, and no upstream test was edited to pass. The feat(slots): agent slot gate on delegate_task (off by default) #89/fork seams: green from upstream on main; a PR's own list is format-checked (#385) #426 cwd: yield* parentWorkspaceCwd(parent) line merges cleanly at tree level. Both delegate paths pass cwd to resolveTargetRechecking (OrchestratorMcpService.ts:2804, :3193), as upstream does.

    • feat(web): file links open remotely, full size, download from their menu #17 ChatMarkdown: this keeps upstream's new openFileInPanel (host ref plus user-action revision) and its issue previews and image-source code. The fork's full-size open (ChatMarkdown.tsx:1017-1018) calls openFileInPanel and then setMaximized. setMaximized is an automaticUpdate and does not bump the revision, so the pending workspace lookup still opens the file. The fork's download and remote editor lines are intact.

    • fix(remote-delegation): a reply from a linked environment on another version still completes its task #540 ReplyPage now keeps thread.itemCount. itemCount has been in OrchestratorMcpThreadDetail since the v2 orchestrator was introduced, so no linked version that answers a thread read lacks it. Without this fix, upstream's tail probe (RemoteDelegation.ts, read.thread.itemCount) would hit an undefined thread on the fallback read. The new paged test covers that case. The test's mock answers any page it does not expect with an undecodable object, so the test cannot pass by reading the wrong pages.

    • hold-work: a held server does not start T3 Connect; tests for every hold (#190) #313 hold-work: holdConnect builds a complete typed CloudLink.of({...}), so a new upstream method that is not refused is a type error rather than a silent pass-through. updateLiveActivityPreference is the only new CloudLink method between the tags, and it is refused. The boot test is stricter, not weaker: the build's relay is now the https fake (its cert has SAN IP:127.0.0.1 and is valid to 2036), and the held boot still asserts relayRequests(remote) is [], so a held boot that reached the relay would now show up. I found no new upstream relay caller outside cloud/. (The new preview/PreviewTunnel.ts rides on the tunnel, which a held server does not start.)

    • feat(waits): delivery and scheduling (part 3, off by default) #91 waits testkit: the fake matches upstream's new atomicWrite.ts: open(temp, {flag:"w"}), writeAll, chmod, sync, rename, and open(dir, {flag:"r"}) then sync. It changes no product code.

    • feat(usage): usage pacing gate on delegate_task (pacing part 4) #73/feat(slots): agent slot gate on delegate_task (off by default) #89 gate tests: getById: () => Effect.succeedNone matches upstream's own OrchestratorMcpService.test.ts:213.

    Fork CI on the candidate

    Run 44646816124 (Fork tests, dispatched with ref = 8b669dfc). The Changes log confirms "Testing 8b669df… in every job". At review time it was still running. Green so far: Build and Typecheck, Lint, Rust, Release Smoke, fork checks, action/fleet walls, workflow lint/drift, and Test Server 1, 2, 4, 5, 7 and 8. Still running: Test 1 and 2, Test Server 3 and 6, Test Web 1 to 3, and Fork kit tests. Check that it finishes green before main moves. The fork secret scan on 8b669dfc passed.

    Findings

    BLOCKING: none.

    MAJOR: none.

    MINOR

    1. The usage pacing gate does not see upstream's new project-config models (apps/server/src/mcp/OrchestratorMcpService.ts:2826, apps/server/src/fork/delegateChecks.ts:167, host wired at OrchestratorMcpService.ts:1748). Upstream c0b1d32 (fix(server): MCP delegation accepts models from the project's own provider config pingdotgg/t3code#39247) accepts delegation models that come from the project's own provider config, through withWorkspaceModels(providers, cwd) inside resolveTargetRechecking. The fork's seat 1 passes the raw providers to delegateChecks.beforeWorkspace. The pacer's targetOn then re-resolves with plain resolveTarget, and advertisedModel(provider, model) reads raw providers too.
      Scenario: usagePacingGate is on, the parent delegates a model that only the project's provider config defines, and the pace says switch or lower effort. The candidate on another instance does not resolve, so there is no switch, and the descriptors are undefined, so there is no effort step. The outcome is conservative: no wrong target, only a missed switch or lower-effort step. The gate is off by default. Upstream's own path is intact. Follow-up: pass withWorkspaceModels(providers, cwd) into the checks. This is not a rebase regression; it is a new upstream feature that the fork add-on does not use yet.
    2. (Pre-existing, not from this rebase; plausible, not reproduced.) In a side chat, "Open full size" (apps/web/src/components/ChatMarkdown.tsx:1018) opens the file in the host panel, because openFile is a userAction routed through panelHosts. But setMaximized(threadRef, true) is an automaticUpdate keyed by the side chat's own key, so the host panel may not maximize. Side-chat hosting predates the old tag, so this rebase did not cause it.

    Correction to the rebase report: it says the waits and hold-work boot tests "are not in .github/fork-ci-tests.txt, so fork CI would not have caught those two breaks." That list only covers the tests of .github/scripts, fork-ci and fork-kit. The Test Server shards run every apps/server test. This run's logs show src/holdWork.boot.test.ts, src/waits/WaitService.*.test.ts, remoteReplyRead.test.ts (5), holdWorkConnect.test.ts (21) and OrchestratorMcpService.usageGate.test.ts (14) passing on the candidate. Fork CI would have caught those breaks.

  3. github-actions commented on Nov 20, 2026

    @github-actions
    Author

    Fork follows upstream

    Plan: Release the series on v0.1.11-nightly.20261119.4954 as it is. Run: https://github.com/scuttletoby/t3code/actions/runs/44647893597

    What State now
    Series branch main not moved: at c174db9b1ead
    Candidate branch fork-follow/candidate at 8b669dfc567d
    Backups of earlier series (tags) fork-follow/pre-v0.1.11-nightly.20261118.4890-1974264545d5, fork-follow/pre-v0.1.11-nightly.20261119.4954-f49745fab25a
    Release v0.1.11-nightly.20261119.4954.fork.1 published at 8b669dfc567d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions