Bump vendored T3 Code to 42c9107983 (v0.1.12-nightly) and catch up

- vendor/t3code submodule pinned to 42c9107983; deps in package.json
  aligned with the upstream catalog, including upstream's effect@4.1.5
  patch via patchedDependencies (patches/effect@4.1.5.patch)
- nix flake.nix devShell provides bun locally (no guix home install)
- scripts/link-vendor.ts now copies the vendored packages into
  node_modules/@t3tools and applies tscPatches for the spots where
  classic tsc can't infer what upstream's Effect language service can,
  so `bun run typecheck` runs clean under full strict mode
- protocol drift fixes across model/ui/client: usage-limit copy, context
  window snapshot, checkpoint totals, turn diff summaries, alert
  observation, "once" schedules, composer trigger kinds, PR keying,
  thread menu state, secret request answers, terminal summaries,
  snapshot-required shell events, revert checkpoint lookup
- new parity features over the typed RPC: fork a turn into a new thread,
  rewind a message with its attachments restored to the composer, guest
  share links and turn-into-project in the thread menu
- tests updated and added (301 pass); typecheck, lint and build clean

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
venomade committed 2026-11-24 00:52:30 +00:00
1 parent 3a93c35c41
commit b40f09e56f
38 files changed
+4786 -63

No files matched your search

+45
View File
@@ -180,6 +180,51 @@ describe("a finished turn", () => {
// The date half is locale- and timezone-shaped; the model and duration are not.
expect(app.frame()).toMatch(/gpt-5\.4 · 3m 12s · /);
});
test("forking a turn dispatches thread.fork and opens the new thread", async () => {
const app = await open({ session: fakeSession({ projection: withCompletedTurn(), results: { forkThread: "thread-fork-1" } }) });
await app.press("]");
await app.press("k", { ctrl: true });
await app.type("fork from this turn");
await app.press("return");
await app.settle(50);
expect(app.calls("forkThread").map((call) => call.args[0])).toEqual([{ sourceThreadId: v2ThreadId, runId: "run-1", title: "Thread fork" }]);
});
test("rewinding a message with attachments puts the prompt and the attachments back", async () => {
const attachment = { type: "image", id: "att-1", name: "shot.png", mimeType: "image/png", sizeBytes: 3 };
const projection = structuredClone(withCompletedTurn()) as unknown as {
messages: { attachments: unknown }[];
turnItems: { type: string; attachments: unknown }[];
visibleTurnItems: { item: { type?: string; attachments: unknown } }[];
thread: Record<string, unknown>;
checkpoints: Record<string, unknown>[];
providerThreads: unknown[];
};
projection.messages[0]!.attachments = [attachment];
projection.turnItems.find((item) => item.type === "user_message")!.attachments = [attachment];
for (const visible of projection.visibleTurnItems) if (visible.item.type === "user_message") visible.item.attachments = [attachment];
// A thread-start checkpoint and a provider thread make turn 0 rewindable.
projection.thread.activeProviderThreadId = "pt-1";
projection.providerThreads = [{ id: "pt-1", providerSessionId: "ps-1", providerInstanceId: "codex" }];
projection.checkpoints.unshift({ id: "checkpoint-0", threadId: projection.thread.id, scopeId: "scope-1", runId: null, nodeId: null, parentCheckpointId: null, ordinalWithinScope: 0, appRunOrdinal: null, ref: "refs/t3/checkpoint-0", status: "ready", files: [], capturedAt: projection.checkpoints[0]!.capturedAt });
const serverConfig = { providers: [{ instanceId: "codex", driver: "codex", enabled: true, auth: { status: "authenticated" }, models: [] }], settings: {}, environment: { capabilities: {} } };
const app = await open({
session: fakeSession({
projection: projection as unknown as OrchestrationV2ThreadProjection,
serverConfig,
results: { attachmentImage: new Uint8Array([1, 2, 3]), uploadAttachment: { type: "image", id: "att-new", name: "shot.png", mimeType: "image/png", sizeBytes: 3 } },
}),
});
await app.press("]");
await app.press("R");
await app.settle(30);
await app.press("return");
await app.settle(80);
expect(app.calls("rewind")).toHaveLength(1);
expect(app.calls("uploadAttachment").map((call) => call.args[0])).toEqual([{ type: "image", name: "shot.png", mimeType: "image/png", sizeBytes: 3 }]);
expect(app.hints()).toBe("Restored 1 attachment");
});
});
describe("live status", () => {
+1 -1
View File
@@ -247,7 +247,7 @@ describe("acting on a file", () => {
await prefix(app, "k");
await app.press("i");
await app.press("return");
expect(app.calls("sendMessage")[0]?.args[1]).toBe("[src](src) [debug.log](debug.log)");
expect(app.calls("sendMessage")[0]?.args[1]).toBe("[src](./src) [debug.log](debug.log)");
});
test("y copies the path", async () => {
+6 -2
View File
@@ -3,7 +3,7 @@ import { tmpdir } from "node:os";
import { join } from "node:path";
import { testRender } from "@opentui/react/test-utils";
import { createMockKeys, type KeyInput } from "@opentui/core/testing";
import type { OrchestrationV2ShellSnapshot, OrchestrationV2ThreadProjection, ThreadId } from "@t3tools/contracts";
import { RunId, type OrchestrationV2ShellSnapshot, type OrchestrationV2ThreadProjection, type ThreadId } from "@t3tools/contracts";
import type { ConnectionStatus, T3Session } from "../../src/client/session.ts";
import { DEFAULT_CONFIG, type T3tuiConfig } from "../../src/config.ts";
@@ -52,7 +52,11 @@ export function fakeSession(
) {
const calls: Call[] = [];
const threadListeners = new Set<(value: unknown) => void>();
const snapshot = state.snapshot ?? v2ShellSnapshot;
// The default thread has a finished run, as upstream's menu tests assume: "Mark unread"
// only shows once the latest run completed.
const snapshot =
state.snapshot ??
({ ...v2ShellSnapshot, threads: v2ShellSnapshot.threads.map((thread) => ({ ...thread, latestRunId: RunId.make("run-v2") })) } as OrchestrationV2ShellSnapshot);
const projection = state.projection ?? v2Projection;
const live = <T,>(value: T) => (listener: (value: T) => void) => {
listener(value);