From 427e7f2cef79a5d39e2b73d55b1b0aa05a2acbb5 Mon Sep 17 00:00:00 2001 From: Renfei Zhou Date: Sat, 21 Nov 2026 04:25:20 +0000 Subject: [PATCH] fix(fork): resolve upstream merge e8b28328da (2026-11-20) Resolve the 16 conflicted files of the merge commit and fix the breaks the merge brought. - Keep both sides where the fork and upstream added beside each other. - Take upstream's attachment resource fix, which matches the fork's. - Right panel: upstream renamed side chat tabs to thread tabs; the fork's Dashboard, Replies and Whiteboard tabs sit beside them, a saved split keeps a side chat tab across the rename, and a linked thread in the unfocused pane of a split keeps updating. - Antigravity status errors: upstream's reader takes only known status names, so a protobuf length byte is no longer read into the status. - The user's own Antigravity CLI keeps its own login: no SSH marker in its launch environment, and its limits read the system keyring again. - Full Chrome for the preview's virtual-display mode moves to 158 with upstream's preview browser. - The display-mode wrap takes upstream's run output instructions with the message text. - Fork tests follow upstream's new Claude session methods, asset route and hub model list; upstream's file preview drag cases each open their own file, as the fork reopens a file where the reader stopped. - Upstream's Sidebar browser tests start from an empty draft store, so drafts another browser test file left in localStorage do not take the jump numbers that upstream now gives unsent drafts. Co-Authored-By: Claude Opus 5.5 --- .../antigravityCliRuntime.test.ts | 33 +++++++++-- .../antigravityCliRuntime.ts | 47 ++++++++-------- .../fork/claudeUsageSource/claudeHub.test.ts | 4 ++ ...DisplayModeCompactionNote.adapters.test.ts | 3 + ...layModeWrap.newContext.integration.test.ts | 31 ++++++++--- .../server/src/fork/generalRoleParity.test.ts | 3 + apps/server/src/fork/hostFiles/http.test.ts | 2 + apps/server/src/fork/previewChrome.ts | 18 +++--- apps/server/src/git/GitManager.ts | 3 - .../ProviderTurnStartService.ts | 21 ++----- .../ThreadManagementService.ts | 11 +--- .../testkit/ProviderReplayHarness.ts | 3 - .../src/provider/Drivers/AntigravityDriver.ts | 1 + ...viderOrchestrationAdapterInfrastructure.ts | 11 +--- .../provider/acp/AntigravityTurnOutcome.ts | 13 ++--- .../src/provider/agentContextBudget.json | 8 +-- .../src/provider/antigravityUsageLimits.ts | 6 +- .../src/relay/AgentAwarenessRelay.test.ts | 3 - apps/server/src/server.ts | 5 -- .../AntigravityTextGeneration.ts | 13 ++--- .../components/ComposerPromptEditorTiptap.tsx | 6 +- apps/web/src/components/RightPanelTabs.tsx | 55 +++++-------------- .../src/components/Sidebar.browser.test.tsx | 12 +++- .../chat/RightPanelSurfaceContent.tsx | 15 ++--- .../files/AttachmentFilePreview.tsx | 10 ---- .../files/FilePreviewPanel.browser.test.tsx | 6 +- .../fork/rightPanelSplit/splitLayout.logic.ts | 17 +++++- .../fork/rightPanelSplit/splitStore.test.ts | 17 +++++- apps/web/src/rightPanelStore.ts | 26 +++------ evals/mcp-tool-use/run.ts | 3 - 30 files changed, 187 insertions(+), 219 deletions(-) diff --git a/apps/server/src/fork/antigravityCliRuntime/antigravityCliRuntime.test.ts b/apps/server/src/fork/antigravityCliRuntime/antigravityCliRuntime.test.ts index 5f5fe35eaff7..fc9e253910d1 100644 --- a/apps/server/src/fork/antigravityCliRuntime/antigravityCliRuntime.test.ts +++ b/apps/server/src/fork/antigravityCliRuntime/antigravityCliRuntime.test.ts @@ -223,15 +223,24 @@ describe("Antigravity CLI runtime", () => { const path = yield* Path.Path; const input = { profileDirectory: "/profile", userHome: "/home/user", path }; const profileArgs = ["acp", "--gemini-dir", "/profile", "--app-data-dir", "antigravity-acp"]; - const spawn = { command: "agy", args: profileArgs, cwd: "/project" }; - for (const [found, managedVersionDirectory, runtime, args] of [ - ["the user's own", null, "cli", ["acp"]], - ["a managed release", "/managed/versions/release", "managed", profileArgs], + // Upstream marks a Google sign-in as an SSH session, so the CLI keeps it in a file. + const profileEnv = { GEMINI_HOME: "/profile", SSH_CONNECTION: "127.0.0.1 0 127.0.0.1 0" }; + const spawn = { command: "agy", args: profileArgs, cwd: "/project", env: profileEnv }; + for (const [found, managedVersionDirectory, runtime, args, env] of [ + ["the user's own", null, "cli", ["acp"], { GEMINI_HOME: "/profile" }], + ["a managed release", "/managed/versions/release", "managed", profileArgs, profileEnv], ] as const) { const executable = { managedVersionDirectory }; assert.equal(antigravityRuntimeState(executable, input).runtime, runtime, found); - assert.deepEqual(withUserAgyState(executable, spawn).args, args, found); + assert.deepEqual(withUserAgyState(executable, spawn, {}).args, args, found); + assert.deepEqual(withUserAgyState(executable, spawn, {}).env, env, found); } + const sshEnv = { SSH_CONNECTION: "10.0.0.1 50000 10.0.0.2 22" }; + assert.deepEqual( + withUserAgyState({ managedVersionDirectory: null }, spawn, sshEnv).env, + { GEMINI_HOME: "/profile", ...sshEnv }, + "the user's own SSH session stays", + ); }).pipe(Effect.provide(NodeServices.layer)), ); @@ -444,11 +453,12 @@ describe("Antigravity CLI runtime", () => { }), ); let runtime: "cli" | "managed" = "cli"; + let keyring: string | undefined; const { probe } = yield* makeAntigravityRuntimeUsageProbe({ profileDirectory, userHome, authMethod: "oauth-personal", - readKeyringSecret: Effect.undefined, + readKeyringSecret: Effect.sync(() => keyring), runtimeState: Effect.sync(() => runtime === "cli" ? antigravityRuntimeState( @@ -481,6 +491,17 @@ describe("Antigravity CLI runtime", () => { JSON.stringify([cli, managed]), /cli-access|cli-refresh|profile-access|profile-refresh|profile-secret/, ); + + // The user's own CLI may keep its Google sign-in only in the system keyring. + yield* fileSystem.remove(path.join(cliApp, "antigravity-oauth-token")); + keyring = JSON.stringify({ + token: { access_token: "keyring-access", expiry: "1970-01-01T01:00:00.123456789Z" }, + }); + runtime = "cli"; + requests.length = 0; + const fromKeyring = yield* probe; + assert.isUndefined(fromKeyring.unavailable); + assert.isTrue(requests.some((request) => request.bearer === "Bearer keyring-access")); }).pipe(Effect.scoped, Effect.provide(layer)), ); }); diff --git a/apps/server/src/fork/antigravityCliRuntime/antigravityCliRuntime.ts b/apps/server/src/fork/antigravityCliRuntime/antigravityCliRuntime.ts index 20957656824a..3cbbb26f4101 100644 --- a/apps/server/src/fork/antigravityCliRuntime/antigravityCliRuntime.ts +++ b/apps/server/src/fork/antigravityCliRuntime/antigravityCliRuntime.ts @@ -57,20 +57,32 @@ export function antigravityRuntimeState( const PROFILE_FLAGS = new Set(["--gemini-dir", "--app-data-dir"]); -/** Upstream points every `agy` at T3's profile; the user's own `agy` keeps its own login and state. */ +/** + * Upstream points every `agy` at T3's profile, and marks a Google sign-in as an SSH session so the + * CLI keeps it in that profile; the user's own `agy` keeps its own login, keyring and state. + */ export const withUserAgyState = ( executable: Pick, spawn: AcpSessionRuntime.AcpSpawnInput, -): AcpSessionRuntime.AcpSpawnInput => - isUserAgy(executable) - ? { - ...spawn, - args: spawn.args.filter( - (arg, index) => - !PROFILE_FLAGS.has(arg) && !PROFILE_FLAGS.has(spawn.args[index - 1] ?? ""), - ), - } - : spawn; + baseEnv: NodeJS.ProcessEnv, +): AcpSessionRuntime.AcpSpawnInput => { + if (!isUserAgy(executable)) return spawn; + const { SSH_CONNECTION: _profileSsh, ...env } = spawn.env ?? {}; + return { + ...spawn, + args: spawn.args.filter( + (arg, index) => !PROFILE_FLAGS.has(arg) && !PROFILE_FLAGS.has(spawn.args[index - 1] ?? ""), + ), + ...(spawn.env === undefined + ? {} + : { + env: + baseEnv.SSH_CONNECTION === undefined + ? env + : { ...env, SSH_CONNECTION: baseEnv.SSH_CONNECTION }, + }), + }; +}; /** The state a caller was given, or the managed profile's when it was given none. */ export const antigravityRuntimeStateOf = (options: { @@ -88,7 +100,7 @@ const antigravityTokenPath = (state: AntigravityRuntimeState, path: Path.Path) = */ export const makeAntigravityRuntimeUsageProbe = Effect.fn("makeAntigravityRuntimeUsageProbe")( function* ( - input: Parameters[0] & { + input: Omit[0], "appDirectory"> & { readonly userHome: string; readonly runtimeState: Effect.Effect; }, @@ -142,17 +154,6 @@ export const readAntigravityAccount = Effect.fn("AntigravityAdapterV2.readAccoun return Option.map(digest, Hex.encode); }); -// google.rpc.Code names. The CLI's error step is length-prefixed, so a length byte that may be -// a capital letter leads the status; only a known name finds where the status starts. -const CLI_API_ERROR = - /(CANCELLED|UNKNOWN|INVALID_ARGUMENT|DEADLINE_EXCEEDED|NOT_FOUND|ALREADY_EXISTS|PERMISSION_DENIED|RESOURCE_EXHAUSTED|FAILED_PRECONDITION|ABORTED|OUT_OF_RANGE|UNIMPLEMENTED|INTERNAL|UNAVAILABLE|DATA_LOSS|UNAUTHENTICATED) \(code (\d{3})\): ([^\p{Cc}]+)/u; - -/** The CLI's `STATUS (code NNN): message`, in the managed pattern's group order: code, message, status. */ -export function antigravityCliApiError(text: string) { - const match = CLI_API_ERROR.exec(text); - return match === null ? null : ([match[0], match[2], match[3], match[1]] as const); -} - const isNativeSessionId = Schema.is(Schema.String.check(Schema.isUUID(4))); /** The length-delimited fields of one protobuf message, or none when the bytes are not one. */ diff --git a/apps/server/src/fork/claudeUsageSource/claudeHub.test.ts b/apps/server/src/fork/claudeUsageSource/claudeHub.test.ts index 36cab501d845..91904612a672 100644 --- a/apps/server/src/fork/claudeUsageSource/claudeHub.test.ts +++ b/apps/server/src/fork/claudeUsageSource/claudeHub.test.ts @@ -55,6 +55,10 @@ function fixture(options: { if (path.endsWith("/auth-files")) { return HttpClientResponse.fromWeb(request, Response.json({ files: options.accounts })); } + // A hub without upstream's per-account model list. + if (path.endsWith("/auth-files/models")) { + return HttpClientResponse.fromWeb(request, new Response(null, { status: 404 })); + } if (path.endsWith("/reset-quota")) { return HttpClientResponse.fromWeb(request, Response.json({})); } diff --git a/apps/server/src/fork/displayModeWrap/DisplayModeCompactionNote.adapters.test.ts b/apps/server/src/fork/displayModeWrap/DisplayModeCompactionNote.adapters.test.ts index a61a5883146f..5c936d46b349 100644 --- a/apps/server/src/fork/displayModeWrap/DisplayModeCompactionNote.adapters.test.ts +++ b/apps/server/src/fork/displayModeWrap/DisplayModeCompactionNote.adapters.test.ts @@ -165,6 +165,9 @@ const startClaudeTurn = Effect.fn("startClaudeTurn")(function* ( mcpServerStatus: Effect.succeed([]), readMcpResource: () => Effect.die("unexpected MCP resource read"), callMcpTool: () => Effect.die("unexpected MCP tool call"), + mcpAuthenticate: () => Effect.die("unexpected MCP sign-in"), + mcpSubmitOAuthCallbackUrl: () => Effect.die("unexpected MCP sign-in"), + reconnectMcpServer: () => Effect.die("unexpected MCP reconnect"), listPermissionRules: Effect.die("unexpected permission rules read"), stopTask: () => Effect.void, interrupt: Effect.void, diff --git a/apps/server/src/fork/displayModeWrap/DisplayModeWrap.newContext.integration.test.ts b/apps/server/src/fork/displayModeWrap/DisplayModeWrap.newContext.integration.test.ts index 1de3033f640d..ebbb0af13af0 100644 --- a/apps/server/src/fork/displayModeWrap/DisplayModeWrap.newContext.integration.test.ts +++ b/apps/server/src/fork/displayModeWrap/DisplayModeWrap.newContext.integration.test.ts @@ -25,6 +25,7 @@ import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import * as PubSub from "effect/PubSub"; import * as Ref from "effect/Ref"; +import type * as Schema from "effect/Schema"; import * as SqlClient from "effect/sql/SqlClient"; import * as Stream from "effect/Stream"; @@ -38,6 +39,7 @@ import { CLAUDE_MODEL_SELECTION, CODEX_MODEL_SELECTION, } from "../../orchestration-v2/testkit/fixtures/shared.ts"; +import { outputInstructions } from "../../orchestration-v2/runOutput.ts"; import * as ProviderReplayHarness from "../../orchestration-v2/testkit/ProviderReplayHarness.ts"; import * as SqlitePersistence from "../../persistence/Sqlite.ts"; import * as ServerSettings from "../../serverSettings.ts"; @@ -219,6 +221,7 @@ const notesPerAttempt = ( ordinal: number, selection?: ModelSelection, text?: string, + outputSchema?: Readonly>, ) => Effect.Effect; readonly failResume: Ref.Ref; readonly failStart: Ref.Ref; @@ -297,6 +300,7 @@ const notesPerAttempt = ( ordinal: number, selection: ModelSelection = CLAUDE_MODEL_SELECTION, text = `Request ${ordinal}`, + outputSchema?: Readonly>, ) { const providerSessionId = (yield* orchestrator.getThreadProjection( threadId, @@ -321,6 +325,7 @@ const notesPerAttempt = ( attachments: [], modelSelection: selection, dispatchMode: { type: "start_immediately" }, + ...(outputSchema === undefined ? {} : { outputSchema }), }); yield* orchestrator.streamStoredEvents.pipe( Stream.filter( @@ -465,16 +470,26 @@ const notesPerAttempt = ( describe("display mode note at turn start", () => { it.live("goes once on the first message, and again after a failed native resume", () => Effect.gen(function* () { - const notes = yield* notesPerAttempt("display-wrap-resume", ({ send, failResume }) => - Effect.gen(function* () { - yield* send(1); - yield* send(2); - yield* Ref.set(failResume, true); - yield* send(3); - yield* send(4); - }), + const outputSchema = { type: "object" }; + const rewrapped = yield* Ref.make(""); + const notes = yield* notesPerAttempt( + "display-wrap-resume", + ({ send, failResume, lastAttempt }) => + Effect.gen(function* () { + yield* send(1); + yield* send(2); + yield* Ref.set(failResume, true); + yield* send(3, undefined, undefined, outputSchema); + yield* Ref.set(rewrapped, yield* lastAttempt); + yield* send(4); + }), ); assert.deepEqual(notes, [true, false, true, false]); + // The re-wrapped prompt keeps one copy of the output instructions, after the user's words. + const text = yield* Ref.get(rewrapped); + const instructions = outputInstructions(outputSchema); + assert.strictEqual(text.split(instructions).length, 2); + assert.isTrue(text.endsWith(`Request 3\n\n${instructions}`)); }), ); diff --git a/apps/server/src/fork/generalRoleParity.test.ts b/apps/server/src/fork/generalRoleParity.test.ts index 066a44628499..16d2f870d33c 100644 --- a/apps/server/src/fork/generalRoleParity.test.ts +++ b/apps/server/src/fork/generalRoleParity.test.ts @@ -257,6 +257,9 @@ const claude: ProviderFixture = { mcpServerStatus: Effect.succeed([]), readMcpResource: () => Effect.die("unexpected MCP resource read"), callMcpTool: () => Effect.die("unexpected MCP tool call"), + mcpAuthenticate: () => Effect.die("unexpected MCP sign-in"), + mcpSubmitOAuthCallbackUrl: () => Effect.die("unexpected MCP sign-in"), + reconnectMcpServer: () => Effect.die("unexpected MCP reconnect"), listPermissionRules: Effect.die("unexpected permission rules read"), stopTask: () => Effect.void, interrupt: Effect.void, diff --git a/apps/server/src/fork/hostFiles/http.test.ts b/apps/server/src/fork/hostFiles/http.test.ts index 89192ffe776d..060f07293ec3 100644 --- a/apps/server/src/fork/hostFiles/http.test.ts +++ b/apps/server/src/fork/hostFiles/http.test.ts @@ -17,6 +17,7 @@ import { HttpRouter } from "effect/http"; import * as AssetSigner from "../../assets/AssetSigner.ts"; import * as NativeAppIconResolver from "../../assets/NativeAppIconResolver.ts"; +import * as WorkspacePreviewRevisions from "../../assets/WorkspacePreviewRevisions.ts"; import * as EnvironmentAuth from "../../auth/EnvironmentAuth.ts"; import * as ServerSecretStore from "../../auth/ServerSecretStore.ts"; import * as ServerConfig from "../../config.ts"; @@ -60,6 +61,7 @@ const layerUnusedAssetServices = Layer.mergeAll( Layer.mock(RepositoryIdentityResolver.RepositoryIdentityResolver)({}), Layer.succeed(BuiltInDrivers.SourceControlDrivers, []), Layer.mock(WorkspacePaths.WorkspacePaths)({}), + Layer.mock(WorkspacePreviewRevisions.WorkspacePreviewRevisions)({}), ); const layerTest = ServerConfig.layerTest(process.cwd(), { prefix: "t3-host-files-http-" }).pipe( diff --git a/apps/server/src/fork/previewChrome.ts b/apps/server/src/fork/previewChrome.ts index 4132edea509e..c6b8f39bcf19 100644 --- a/apps/server/src/fork/previewChrome.ts +++ b/apps/server/src/fork/previewChrome.ts @@ -8,23 +8,23 @@ import type { PreviewBrowserRelease } from "../preview/PreviewBrowser.ts"; // macOS keeps the shell: the Chrome app bundle holds symlinks the installer will not unpack. // Pin from each chrome zip in known-good-versions-with-downloads.json, at PreviewBrowser.VERSION: // the browser's --user-agent names that version in both modes. -const VERSION = "157.0.8103.78"; +const VERSION = "158.0.8127.36"; const ARCHIVES: Partial> = { linux64: { - bytes: 203_266_906, - sha256: "9223832977a13db3646201b1341c1f9cf08afa3ceae92540116d7b0c062364fb", + bytes: 208_062_943, + sha256: "dba9cc838e1ce269c33ea68170881127bd15d078fc3ca5891c90802819a4d7c7", }, "linux-arm64": { - bytes: 203_144_198, - sha256: "f354d666822a11d8fe99e923c44be77dd226fab2750c5b5947e6318818bf10f1", + bytes: 205_790_900, + sha256: "f811b64a50cbc73f94fda7b3f3b3bf62be5d9409b3207e6ead9b61e6706afffe", }, win32: { - bytes: 190_974_375, - sha256: "313261468c4b205198778b112c9ac6e44dff0ff501085b0f9336d7feae2b3715", + bytes: 196_218_437, + sha256: "427a02beb8887ceca6a1847dc67445580741c8c40bd15af334993d3a59863943", }, win64: { - bytes: 209_854_321, - sha256: "5f6ec40206407112702e163bf694d07f9fdc8ccbd346c70ce61fa62f716493f9", + bytes: 214_927_656, + sha256: "6a8ad290952cc612c7777ffb3eb62f345539a2a1a8d440cfac190c6d36b34d2c", }, }; diff --git a/apps/server/src/git/GitManager.ts b/apps/server/src/git/GitManager.ts index a4c32fa187dc..c7a600ace18e 100644 --- a/apps/server/src/git/GitManager.ts +++ b/apps/server/src/git/GitManager.ts @@ -851,9 +851,7 @@ export const make = Effect.gen(function* () { } return result; }); -<<<<<<< origin/main const hostPlatform = yield* HostProcess.Platform; -======= const createPrNeedsPush = Effect.fn("GitManager.createPrNeedsPush")(function* ( cwd: string, status: { @@ -870,7 +868,6 @@ export const make = Effect.gen(function* () { .pipe(Effect.orElseSucceed(() => null)); return target?.viaPushRemote === true; }); ->>>>>>> upstream/main const readWorktreeCreationSettings = serverSettingsService.getSettings.pipe( Effect.map((settings) => ({ worktreesDirectory: settings.worktreesDirectory, diff --git a/apps/server/src/orchestration-v2/ProviderTurnStartService.ts b/apps/server/src/orchestration-v2/ProviderTurnStartService.ts index 313c269d7b86..8ef9256e3996 100644 --- a/apps/server/src/orchestration-v2/ProviderTurnStartService.ts +++ b/apps/server/src/orchestration-v2/ProviderTurnStartService.ts @@ -992,21 +992,6 @@ export const layer: Layer.Layer< }); let effectiveHandoffs = handoffs; let resumeFellBack = false; -<<<<<<< origin/main - const wrapInput = { - threadId: run.threadId, - message: providerMessage, - text: withMessageSenderNote( - providerMessage, - projectComposerContextForProvider({ - text: providerMessage.text, - records: providerMessage.context?.records ?? [], - }), - ), - }; - let wrapped = yield* displayModeWrap.wrapUserText(wrapInput); - let userText = wrapped.text; -======= const messageText = withMessageSenderNote( providerMessage, projectComposerContextForProvider({ @@ -1014,7 +999,6 @@ export const layer: Layer.Layer< records: providerMessage.context?.records ?? [], }), ); ->>>>>>> upstream/main // Native goal commands go verbatim; handoff history waits a turn. const goalDriver = session.driver === "codex" || @@ -1022,10 +1006,13 @@ export const layer: Layer.Layer< session.providerSession.capabilities.turns.supportsNativeGoals === true; const goalCommand = goalDriver && parseGoalCommand(providerMessage) !== null; // Part of the user text, so every way a turn starts carries it, after the user's own words. - const userText = + const unwrappedText = run.outputSchema === undefined || goalCommand || isProviderCommand(providerMessage) ? messageText : `${messageText}\n\n${outputInstructions(run.outputSchema)}`; + const wrapInput = { threadId: run.threadId, message: providerMessage, text: unwrappedText }; + let wrapped = yield* displayModeWrap.wrapUserText(wrapInput); + let userText = wrapped.text; // The provider turn marks cancellation work delivered; restart continuations use their own text or resume natively. const noteContinuation = isRestartNoteContinuation( run, diff --git a/apps/server/src/orchestration-v2/ThreadManagementService.ts b/apps/server/src/orchestration-v2/ThreadManagementService.ts index 0ef3f778335d..559985812e28 100644 --- a/apps/server/src/orchestration-v2/ThreadManagementService.ts +++ b/apps/server/src/orchestration-v2/ThreadManagementService.ts @@ -499,19 +499,16 @@ export interface ThreadManagementServiceShape { readonly sendToThread: ( input: ThreadManagementSendInput, ) => Effect.Effect; -<<<<<<< origin/main /** Starts no turn, so it neither restores the worktree nor needs the provider enabled. */ readonly postFyi: ( input: ThreadManagementFyiInput, ) => Effect.Effect; -======= /** Stores what the thread's running turn returns, once it fits the schema that turn declared. */ readonly submitRunOutput: (input: { readonly threadId: ThreadId; readonly commandId: CommandId; readonly json: string; }) => Effect.Effect<{ readonly runId: RunId }, ThreadManagementFailure>; ->>>>>>> upstream/main readonly assertProviderInstanceEnabled: (input: { readonly projectId: ProjectId; readonly commandId: CommandId; @@ -1050,7 +1047,6 @@ const make = Effect.gen(function* () { return { dispatch: dispatched, projection, message, run, turnItem, delivery }; }); -<<<<<<< origin/main const postFyi: ThreadManagementServiceShape["postFyi"] = Effect.fn( "ThreadManagementService.postFyi", )(function* (input) { @@ -1074,7 +1070,8 @@ const make = Effect.gen(function* () { return yield* ensureCommandTranscripts(command).pipe( Effect.andThen(orchestrator.dispatch(command)), ); -======= + }); + const submitRunOutput: ThreadManagementServiceShape["submitRunOutput"] = Effect.fn( "ThreadManagementService.submitRunOutput", )(function* (input) { @@ -1114,7 +1111,6 @@ const make = Effect.gen(function* () { value: checked.success, }); return { runId: run.id }; ->>>>>>> upstream/main }); const waitForThread: ThreadManagementServiceShape["waitForThread"] = Effect.fn( @@ -1910,11 +1906,8 @@ const make = Effect.gen(function* () { getThreadLinkMetadata: orchestrator.getThreadLinkMetadata, listProjectThreads, sendToThread, -<<<<<<< origin/main postFyi, -======= submitRunOutput, ->>>>>>> upstream/main assertProviderInstanceEnabled, isProviderInstanceEnabledForProject, hasReceipt, diff --git a/apps/server/src/orchestration-v2/testkit/ProviderReplayHarness.ts b/apps/server/src/orchestration-v2/testkit/ProviderReplayHarness.ts index 61bad801abab..52b99c50a55d 100644 --- a/apps/server/src/orchestration-v2/testkit/ProviderReplayHarness.ts +++ b/apps/server/src/orchestration-v2/testkit/ProviderReplayHarness.ts @@ -297,15 +297,12 @@ export function layerWithRegistry( store: ProjectionStore.ProjectionStoreV2Shape, ) => ProjectionStore.ProjectionStoreV2Shape; readonly managedPolicy?: ManagedPolicyDocument; -<<<<<<< origin/main /** Turns on MCP setup for each thread, with credentials from this registry. */ readonly mcpSessionRegistry?: McpSessionRegistry.McpSessionRegistryShape; -======= /** The instances the ingestor reads snapshots from, such as an endpoint behind a hub. */ readonly providerInstances?: Partial< ProviderInstanceRegistry.ProviderInstanceRegistry["Service"] >; ->>>>>>> upstream/main } = {}, ): Layer.Layer< | Orchestrator.OrchestratorV2 diff --git a/apps/server/src/provider/Drivers/AntigravityDriver.ts b/apps/server/src/provider/Drivers/AntigravityDriver.ts index d86bd4486be9..dd2b004ade53 100644 --- a/apps/server/src/provider/Drivers/AntigravityDriver.ts +++ b/apps/server/src/provider/Drivers/AntigravityDriver.ts @@ -299,6 +299,7 @@ export const AntigravityDriver: ProviderDriver< auth, runtimeTempDirectory, }), + baseEnv, ), }; }); diff --git a/apps/server/src/provider/ProviderOrchestrationAdapterInfrastructure.ts b/apps/server/src/provider/ProviderOrchestrationAdapterInfrastructure.ts index 83d605ba978d..79559ef7d127 100644 --- a/apps/server/src/provider/ProviderOrchestrationAdapterInfrastructure.ts +++ b/apps/server/src/provider/ProviderOrchestrationAdapterInfrastructure.ts @@ -11,13 +11,10 @@ import * as CursorAgentSdkProcessRunner from "@t3tools/provider-cursor/server/Cu import * as CursorSdk from "@t3tools/provider-cursor/server/CursorSdk"; import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator"; import * as ProviderContinuationRequests from "@t3tools/provider-core/server/ProviderContinuationRequests"; -<<<<<<< origin/main import * as DisplayModeCompactionNote from "../fork/displayModeWrap/DisplayModeCompactionNote.ts"; import type * as FyiDelivery from "../fork/fyi/FyiDelivery.ts"; import * as RuntimeLayer from "../orchestration-v2/runtimeLayer.ts"; -======= import * as HostProcess from "@t3tools/shared/HostProcess"; ->>>>>>> upstream/main export type ProviderOrchestrationAdapterInfrastructure = | ClaudeAdapterV2.ClaudeAgentSdkQueryRunner @@ -70,11 +67,6 @@ const resolveCursorWorkerLaunch = Effect.gen(function* () { export const layer = Layer.mergeAll( ClaudeAdapterV2.layerQueryRunner, CodexAdapterV2.layerAppServerClientFactory, -<<<<<<< origin/main - CursorAgentSdk.layer.pipe(Layer.provideMerge(CursorSdk.layer)), - DisplayModeCompactionNote.layer, - RuntimeLayer.layerFyiDelivery, -======= Layer.unwrap( Effect.gen(function* () { const path = yield* Path.Path; @@ -84,7 +76,8 @@ export const layer = Layer.mergeAll( }), ), CursorSdk.layer, ->>>>>>> upstream/main + DisplayModeCompactionNote.layer, + RuntimeLayer.layerFyiDelivery, layerIdAllocator, ProviderContinuationRequests.layer, ); diff --git a/apps/server/src/provider/acp/AntigravityTurnOutcome.ts b/apps/server/src/provider/acp/AntigravityTurnOutcome.ts index e010a54a365a..9db752ac72ba 100644 --- a/apps/server/src/provider/acp/AntigravityTurnOutcome.ts +++ b/apps/server/src/provider/acp/AntigravityTurnOutcome.ts @@ -11,10 +11,7 @@ import * as Option from "effect/Option"; import * as Schema from "effect/Schema"; import type * as EffectAcpSchema from "effect-acp/compat"; -import { - antigravityCliApiError, - type AntigravityRuntimeState, -} from "../../fork/antigravityCliRuntime/antigravityCliRuntime.ts"; +import type { AntigravityRuntimeState } from "../../fork/antigravityCliRuntime/antigravityCliRuntime.ts"; import { antigravityManagedPath, antigravityProfileRoot } from "./AntigravityProfilePaths.ts"; // CORTEX_STEP_TYPE_ERROR_MESSAGE in the native trajectory. @@ -26,7 +23,9 @@ const MAX_ERROR_PAYLOAD_BYTES = 16_384; // The Go harness's rendering of a Google API error, as the agent's api_errors.py reads it. const API_ERROR = /Error (\d{3}), Message: (.+?), Status: ([A-Z_]+)/s; // Antigravity 1.5 with a Google account writes "STATUS (code NNN): message". -const STATUS_ERROR = /(?>>>>>> upstream/main const reusable = (failure: OrchestrationV2ProviderFailure) => ({ failure, threadDisposition: "reusable" }) as const; if (stopReason === "refusal" || QUOTA_EXHAUSTED.test(text)) { diff --git a/apps/server/src/provider/agentContextBudget.json b/apps/server/src/provider/agentContextBudget.json index 52a0609b3997..93f296ddb7c8 100644 --- a/apps/server/src/provider/agentContextBudget.json +++ b/apps/server/src/provider/agentContextBudget.json @@ -1,11 +1,5 @@ { -<<<<<<< origin/main "claudeSystemAppendBytes": 5945, "codexAdditionalContextBytes": 7339, - "mcpToolListJsonBytes": 62842 -======= - "claudeSystemAppendBytes": 6245, - "codexAdditionalContextBytes": 7639, - "mcpToolListJsonBytes": 58399 ->>>>>>> upstream/main + "mcpToolListJsonBytes": 63920 } diff --git a/apps/server/src/provider/antigravityUsageLimits.ts b/apps/server/src/provider/antigravityUsageLimits.ts index b9a222c96581..6c62e9ba2565 100644 --- a/apps/server/src/provider/antigravityUsageLimits.ts +++ b/apps/server/src/provider/antigravityUsageLimits.ts @@ -326,7 +326,7 @@ export const makeAntigravityUsageProbe = Effect.fn("makeAntigravityUsageProbe")( readonly profileDirectory: string; readonly authMethod: AntigravitySettings["authMethod"]; readonly readKeyringSecret?: Effect.Effect; - /** The runtime's app data folder, which holds its sign-in; the profile's when absent. */ + /** The user's own CLI's app data folder, which holds its sign-in; the profile's when absent. */ readonly appDirectory?: string; }) { const fs = yield* FileSystem.FileSystem; @@ -363,10 +363,10 @@ export const makeAntigravityUsageProbe = Effect.fn("makeAntigravityUsageProbe")( let projectId: string | undefined; if (!(yield* fs.exists(tokenPath))) { cached = undefined; - // Google account instances bypass the keyring, whose one entry every profile shares. + // T3's Google account profiles bypass the keyring, whose one entry every profile shares. const stored = (yield* fs.exists(cliTokenPath)) ? yield* fs.readFileString(cliTokenPath) - : input.authMethod === "oauth-business" + : input.authMethod === "oauth-business" || input.appDirectory !== undefined ? yield* readKeyringSecret : undefined; if (stored === undefined) { diff --git a/apps/server/src/relay/AgentAwarenessRelay.test.ts b/apps/server/src/relay/AgentAwarenessRelay.test.ts index 0f7bf7acacb9..8c031c8c9226 100644 --- a/apps/server/src/relay/AgentAwarenessRelay.test.ts +++ b/apps/server/src/relay/AgentAwarenessRelay.test.ts @@ -250,11 +250,8 @@ const makeTestRelay = Effect.fnUntraced(function* ( getProjectThreadRecords: () => Effect.die("unused project record read"), listProjectThreads: unused, sendToThread: unused, -<<<<<<< origin/main postFyi: unused, -======= submitRunOutput: unused, ->>>>>>> upstream/main assertProviderInstanceEnabled: unused, isProviderInstanceEnabledForProject: unused, hasReceipt: unused, diff --git a/apps/server/src/server.ts b/apps/server/src/server.ts index 515642ab16fd..e1d191401494 100644 --- a/apps/server/src/server.ts +++ b/apps/server/src/server.ts @@ -904,13 +904,8 @@ const layerMakeRoutes = Layer.mergeAll( Layer.provide(Layer.merge(DesktopBrowserChannel.layer, PreviewAgentActivity.layer)), ), ), -<<<<<<< origin/main Layer.provide(PreviewBrowserMode.layer), - // Links to other environments, shared by Settings (WebSocket) and agents (/mcp). -======= - Layer.provide(PreviewBrowser.layer), // Links to other environments, shared by clients (WebSocket) and agents (/mcp). ->>>>>>> upstream/main Layer.provide( Layer.mergeAll(PeerForwarding.layer, PeerThreadRelay.layer, PeerClientPairing.layer).pipe( Layer.provideMerge(PeerMcpClient.layer), diff --git a/apps/server/src/textGeneration/AntigravityTextGeneration.ts b/apps/server/src/textGeneration/AntigravityTextGeneration.ts index 280d9cdcd872..b621670ae374 100644 --- a/apps/server/src/textGeneration/AntigravityTextGeneration.ts +++ b/apps/server/src/textGeneration/AntigravityTextGeneration.ts @@ -11,20 +11,15 @@ import * as Scope from "effect/Scope"; import * as Stream from "effect/Stream"; import { type AcpError, AcpRequestError } from "effect-acp/errors"; -<<<<<<< origin/main -import { applyAntigravityAcpModelSelection } from "../provider/acp/AntigravityAcpSupport.ts"; +import { + antigravityThinkingConfig, + applyAntigravityAcpModelSelection, +} from "../provider/acp/AntigravityAcpSupport.ts"; import { antigravityRuntimeStateOf, removeAntigravityRuntimeSessionFiles, type AntigravityRuntimeState, } from "../fork/antigravityCliRuntime/antigravityCliRuntime.ts"; -======= -import { - antigravityThinkingConfig, - applyAntigravityAcpModelSelection, -} from "../provider/acp/AntigravityAcpSupport.ts"; -import { removeAntigravitySessionFiles } from "../provider/acp/AntigravitySessionFiles.ts"; ->>>>>>> upstream/main import { ANTIGRAVITY_SIGN_IN_REQUIRED_MESSAGE, isAntigravitySignInRequiredError, diff --git a/apps/web/src/components/ComposerPromptEditorTiptap.tsx b/apps/web/src/components/ComposerPromptEditorTiptap.tsx index 4888550e7dbf..a2ea9a6a6812 100644 --- a/apps/web/src/components/ComposerPromptEditorTiptap.tsx +++ b/apps/web/src/components/ComposerPromptEditorTiptap.tsx @@ -320,11 +320,7 @@ function ComposerMentionNodeView({ node }: NodeViewProps) { path={path} environmentId={actions.environmentId} cwd={actions.cwd} -<<<<<<< origin/main - label={boardMatch?.[1] ?? basenameOfPath(path)} -======= - label={basenameOfPath(path).normalize("NFC")} ->>>>>>> upstream/main + label={boardMatch?.[1] ?? basenameOfPath(path).normalize("NFC")} theme={resolvedThemeFromDocument()} /> diff --git a/apps/web/src/components/RightPanelTabs.tsx b/apps/web/src/components/RightPanelTabs.tsx index c71f6e84bc1d..48f8da169d4c 100644 --- a/apps/web/src/components/RightPanelTabs.tsx +++ b/apps/web/src/components/RightPanelTabs.tsx @@ -148,20 +148,14 @@ export interface RightPanelTabsProps { onActivate: (surface: RightPanelSurface) => void; onRenameDevice?: (surfaceId: string, title: string) => void; onCloseSurface: (surface: RightPanelSurface) => void; -<<<<<<< origin/main - /** `strip` is the strip that opened the menu: one pane of a split, or every tab. */ - onCloseOtherSurfaces: (surface: RightPanelSurface, strip: readonly RightPanelSurface[]) => void; - onCloseSurfacesToRight: (surface: RightPanelSurface, strip: readonly RightPanelSurface[]) => void; - onCloseAllSurfaces: (strip: readonly RightPanelSurface[]) => void; -======= /** Moves a subagent, side chat or linked thread tab to the main screen. */ onOpenInMainView?: ( surface: Extract, ) => void; - onCloseOtherSurfaces: (surface: RightPanelSurface) => void; - onCloseSurfacesToRight: (surface: RightPanelSurface) => void; - onCloseAllSurfaces: () => void; ->>>>>>> upstream/main + /** `strip` is the strip that opened the menu: one pane of a split, or every tab. */ + onCloseOtherSurfaces: (surface: RightPanelSurface, strip: readonly RightPanelSurface[]) => void; + onCloseSurfacesToRight: (surface: RightPanelSurface, strip: readonly RightPanelSurface[]) => void; + onCloseAllSurfaces: (strip: readonly RightPanelSurface[]) => void; onMoveSurface?: (surfaceId: string, toIndex: number) => void; onCopyFilePath: (relativePath: string) => void; onDuplicateBrowser?: (surface: RightPanelSurface) => void; @@ -652,14 +646,6 @@ function surfaceTitle( return /^\d+$/.test(surface.key) ? `#${surface.key}` : surface.key; case "device": return surface.title ?? surface.target?.name ?? resolve(msg("Device")); -<<<<<<< origin/main - case "side-chat": - return resolve(msg("Side chat")); - case "dashboard": - case "replies": - case "whiteboard": - return modeSurfaceLabel(surface.kind); -======= case "thread": // Until the thread's own title loads. return resolve(msg("Thread")); @@ -668,7 +654,10 @@ function surfaceTitle( surface, resolve(msg("Thread on {label}", { label: surface.label })), ); ->>>>>>> upstream/main + case "dashboard": + case "replies": + case "whiteboard": + return modeSurfaceLabel(surface.kind); case "preview": { const snapshot = surface.resourceId ? sessions[surface.resourceId] : null; if (!snapshot || snapshot.navStatus._tag === "Idle") return resolve(msg("Browser")); @@ -761,15 +750,12 @@ function SurfaceIcon({ return ; case "thread": return ; -<<<<<<< origin/main + case "linked-thread": + return ; case "dashboard": case "replies": case "whiteboard": return ; -======= - case "linked-thread": - return ; ->>>>>>> upstream/main case "device": return surface.target?.platform === "ios" ? ( @@ -1221,33 +1207,24 @@ export function RightPanelTabs(props: RightPanelTabsProps) { setAddSurfaceMenuOpen(true); } }); -<<<<<<< origin/main - // Inside ChatView's split view, which owns the shell and the split menu entries. - const pane = useRightPanelPane(); - const takesNewSurfaceShortcut = props.open !== false && pane?.focused !== false; - // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- subscribes a document keydown listener for the new surface shortcut while the panel is open -======= // Forwarded from a focused browser page. Focusing the trigger here would let ChatView's // window-focus handler see a plain button and refocus the composer, closing the menu. const onMenuAction = useEffectEvent((action: string) => { if (action === "rightPanel.new" && !addSurfaceMenuBlocked()) setAddSurfaceMenuOpen(true); }); + // Inside ChatView's split view, which owns the shell and the split menu entries. + const pane = useRightPanelPane(); + const takesNewSurfaceShortcut = props.open !== false && pane?.focused !== false; // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- subscribes document keydown and the desktop menu action (forwarded from a focused browser page) for the new surface shortcut while the panel is open ->>>>>>> upstream/main useEffect(() => { if (!takesNewSurfaceShortcut) return; document.addEventListener("keydown", onNewSurfaceKeyDown, true); -<<<<<<< origin/main - return () => document.removeEventListener("keydown", onNewSurfaceKeyDown, true); - }, [takesNewSurfaceShortcut]); -======= const unsubscribe = window.desktopBridge?.onMenuAction(onMenuAction); return () => { document.removeEventListener("keydown", onNewSurfaceKeyDown, true); unsubscribe?.(); }; - }, [props.open]); ->>>>>>> upstream/main + }, [takesNewSurfaceShortcut]); const updateTabScrollState = (viewport: HTMLDivElement) => { const hasOverflow = viewport.scrollWidth - viewport.clientWidth > TAB_SCROLL_EDGE_TOLERANCE; @@ -1377,14 +1354,10 @@ export function RightPanelTabs(props: RightPanelTabsProps) { const surfaceIndex = props.surfaces.findIndex((entry) => entry.id === surface.id); if (surfaceIndex < 0) return; -<<<<<<< origin/main const items: ContextMenuItem[] = []; -======= - const items: ContextMenuItem[] = []; if ((surface.kind === "thread" || surface.kind === "linked-thread") && props.onOpenInMainView) { items.push({ id: "open-in-main-view", label: gt("Open in main view") }); } ->>>>>>> upstream/main if (surface.kind === "device" && props.onRenameDevice) items.push({ id: "rename", label: gt("Rename") }); if (surface.kind === "file" && surface.attachment === undefined) { diff --git a/apps/web/src/components/Sidebar.browser.test.tsx b/apps/web/src/components/Sidebar.browser.test.tsx index 1a0b4c588d64..fb975ed3b767 100644 --- a/apps/web/src/components/Sidebar.browser.test.tsx +++ b/apps/web/src/components/Sidebar.browser.test.tsx @@ -135,9 +135,8 @@ describe("sidebar header new thread", () => { // regression: #38623 unsent drafts are listed above threads but mod+1..9 skipped them describe("sidebar numbered jumps", () => { it("numbers the unsent draft at the top before the threads below it", async () => { - const initial = useComposerDraftStore.getState(); using stack = new DisposableStack(); - stack.defer(() => useComposerDraftStore.setState(initial, true)); + const initial = emptyDraftStore(stack); const previousSettings = getClientSettings(); stack.defer(() => __setClientSettingsForTests(previousSettings)); __setClientSettingsForTests(DEFAULT_CLIENT_SETTINGS); @@ -194,6 +193,14 @@ describe("sidebar numbered jumps", () => { }); }); +// Earlier browser test files share this origin's localStorage, so the store loads their drafts. +function emptyDraftStore(stack: DisposableStack) { + const saved = useComposerDraftStore.getState(); + stack.defer(() => useComposerDraftStore.setState(saved, true)); + useComposerDraftStore.setState(useComposerDraftStore.getInitialState(), true); + return useComposerDraftStore.getState(); +} + function threadShell(projectId: ProjectId, index: number): EnvironmentThreadShell { return makeThreadFixture({ environmentId: EnvironmentId.make("local"), @@ -207,6 +214,7 @@ describe("sidebar render isolation", () => { // regression: #33100 Cmd+J re-rendered every sidebar row, which took hundreds of ms with many threads it("does not re-render thread rows when a quick Mod shortcut opens and focuses the terminal", async () => { using stack = new DisposableStack(); + emptyDraftStore(stack); const activeProject = project("active"); const threads = Array.from({ length: 5 }, (_, index) => threadShell(activeProject.id, index)); const routeThreadRef: ScopedThreadRef = { diff --git a/apps/web/src/components/chat/RightPanelSurfaceContent.tsx b/apps/web/src/components/chat/RightPanelSurfaceContent.tsx index aa78c977d140..fdc82c80e5fd 100644 --- a/apps/web/src/components/chat/RightPanelSurfaceContent.tsx +++ b/apps/web/src/components/chat/RightPanelSurfaceContent.tsx @@ -12,16 +12,12 @@ import type { } from "@t3tools/contracts"; import { scopedThreadKey } from "@t3tools/client-runtime/environment"; import { lazy, Suspense } from "react"; -<<<<<<< origin/main -import SideChatPane from "./SideChatPane"; +import { LinkedThreadPane } from "./LinkedThreadPane"; +import SideThreadPane from "./SideThreadPane"; import { ThreadDashboardPanel } from "../../fork/dashboard/ThreadDashboardPanel"; import type { CiteAssistantText } from "../../fork/dashboard/dashboardCitation"; import { SubThreadsPanel } from "../../fork/subThreads/SubThreadsPanel"; import { WhiteboardPanel } from "../../fork/whiteboard/WhiteboardPanel"; -======= -import { LinkedThreadPane } from "./LinkedThreadPane"; -import SideThreadPane from "./SideThreadPane"; ->>>>>>> upstream/main import type { ComposerImageAttachment, DraftId } from "../../composerDraftStore"; import type { ShortcutMatchContext } from "../../keybindings"; import type { SideChatParentPanel } from "../../lib/sideChatPane"; @@ -223,7 +219,6 @@ export function RightPanelSurfaceContent(props: { ); case "pull-requests": return ; -<<<<<<< origin/main case "dashboard": return ( ; - case "side-chat": -======= case "thread": ->>>>>>> upstream/main // Not lazy: revealing a suspended tiptap editor tears down its view and crashes the composer. return ( ); case "linked-thread": + // Every surface rendered here is on screen: a split shows its unfocused pane too. return ( ); case "device": diff --git a/apps/web/src/components/files/AttachmentFilePreview.tsx b/apps/web/src/components/files/AttachmentFilePreview.tsx index 187fd8efb730..00954b39294a 100644 --- a/apps/web/src/components/files/AttachmentFilePreview.tsx +++ b/apps/web/src/components/files/AttachmentFilePreview.tsx @@ -139,14 +139,9 @@ export function AttachmentFilePreview(props: { const { copyToClipboard, isCopied } = useCopyToClipboard({ target: namedClipboardTarget(props.name), }); -<<<<<<< origin/main - // useAssetUrlRefresh keys its callback on these objects, so they must stay cached. A parent may - // rebuild `asset` on any render, so the attachment's own resource depends only on its fields. -======= // useAssetUrlRefresh keys its callback on these objects, so they must stay cached. Parents // rebuild `asset` on every render, so the attachment resource derives only from its fields. const assetResource = props.asset && "resource" in props.asset ? props.asset.resource : null; ->>>>>>> upstream/main const attachmentResource = attachmentId ? { _tag: "attachment" as const, @@ -156,12 +151,7 @@ export function AttachmentFilePreview(props: { disposition: "inline" as const, } : null; -<<<<<<< origin/main - const resource = - props.asset && "resource" in props.asset ? props.asset.resource : attachmentResource; -======= const resource = assetResource ?? attachmentResource; ->>>>>>> upstream/main const downloadResource = resource ? resource._tag === "draft-workspace-file" ? resource diff --git a/apps/web/src/components/files/FilePreviewPanel.browser.test.tsx b/apps/web/src/components/files/FilePreviewPanel.browser.test.tsx index 714e45bac76f..c40d1c5a5eeb 100644 --- a/apps/web/src/components/files/FilePreviewPanel.browser.test.tsx +++ b/apps/web/src/components/files/FilePreviewPanel.browser.test.tsx @@ -410,8 +410,10 @@ describe("source file scroll", () => { const lines = Array.from({ length: 400 }, (_, index) => `line ${index + 1} markdown content`); const contents = `${lines.join("\n")}\n`; + // A file reopens where the reader stopped, so each case opens its own file. + const name = `notes-${startLine}.md`; state.file = { - relativePath: "notes.md", + relativePath: name, contents, byteLength: contents.length, truncated: false, @@ -419,7 +421,7 @@ describe("source file scroll", () => { await using screen = await render(
- {filePreview("notes.md")} + {filePreview(name)}
, ); diff --git a/apps/web/src/fork/rightPanelSplit/splitLayout.logic.ts b/apps/web/src/fork/rightPanelSplit/splitLayout.logic.ts index 2c85d222a538..9f8248a9fee4 100644 --- a/apps/web/src/fork/rightPanelSplit/splitLayout.logic.ts +++ b/apps/web/src/fork/rightPanelSplit/splitLayout.logic.ts @@ -359,6 +359,21 @@ export function restorePersistedSplit(record: T, raw }); } +// Builds before side chat tabs became `thread` tabs saved their ids as `side-chat:`. +const renamedSideChatIds = (rawSplit: unknown): unknown => { + if (!rawSplit || typeof rawSplit !== "object") return rawSplit; + const rename = (id: unknown) => + typeof id === "string" && id.startsWith("side-chat:") + ? `thread:${id.slice("side-chat:".length)}` + : id; + const { rightIds, otherShownId } = rawSplit as Record; + return { + ...rawSplit, + rightIds: Array.isArray(rightIds) ? rightIds.map(rename) : rightIds, + otherShownId: rename(otherShownId), + }; +}; + /** The migration's hook: the split, and the order it needs, for a record rebuilt from storage. */ export function persistedSplitFields( record: { readonly surfaces: RightPanelSurface[]; readonly activeSurfaceId: string | null }, @@ -366,7 +381,7 @@ export function persistedSplitFields( ): Partial> { const restored = restorePersistedSplit< Pick - >(record, rawSplit); + >(record, renamedSideChatIds(rawSplit)); return restored.split === undefined ? {} : { split: restored.split, surfaces: restored.surfaces }; } diff --git a/apps/web/src/fork/rightPanelSplit/splitStore.test.ts b/apps/web/src/fork/rightPanelSplit/splitStore.test.ts index 0ee99e5ad6fe..858af84c9d85 100644 --- a/apps/web/src/fork/rightPanelSplit/splitStore.test.ts +++ b/apps/web/src/fork/rightPanelSplit/splitStore.test.ts @@ -72,7 +72,7 @@ describe("right panel split in the store", () => { expect(thread().activeSurfaceId).toBe("file:a.ts"); }); - it("migrates a v14 record without a split and keeps a v15 split", () => { + it("migrates a v14 record without a split and keeps a later split, side chats renamed", () => { const record = { isOpen: true, activeSurfaceId: "file:b.ts", @@ -102,6 +102,19 @@ describe("right panel split in the store", () => { key ]?.split, ).toEqual(split); + const sideChat = { id: "side-chat:child", kind: "side-chat", threadId: "child" }; + expect( + migratePersistedRightPanelState({ + byThreadKey: { + [key]: { + ...record, + activeSurfaceId: "side-chat:child", + surfaces: [record.surfaces[0], sideChat], + split: { rightIds: ["side-chat:child"], otherShownId: "file:a.ts", ratio: 0.4 }, + }, + }, + }).byThreadKey[key]?.split, + ).toEqual({ rightIds: ["thread:child"], otherShownId: "file:a.ts", ratio: 0.4 }); }); it("round-trips a split through storage and repairs a same-version record", async () => { @@ -110,7 +123,7 @@ describe("right panel split in the store", () => { const saved = thread().split; const { storage, name } = useRightPanelStore.persist.getOptions(); const persisted = (await storage!.getItem(name!))!; - expect(persisted.version).toBe(15); + expect(persisted.version).toBe(16); // Resetting the store writes it to storage, so the saved value goes back before rehydrating. const reload = async (value: typeof persisted) => { useRightPanelStore.setState(useRightPanelStore.getInitialState()); diff --git a/apps/web/src/rightPanelStore.ts b/apps/web/src/rightPanelStore.ts index d356373e5328..a758880b19de 100644 --- a/apps/web/src/rightPanelStore.ts +++ b/apps/web/src/rightPanelStore.ts @@ -41,15 +41,11 @@ const RIGHT_PANEL_KINDS = [ "pull-request", "pull-requests", "issue", -<<<<<<< origin/main - "side-chat", + "thread", + "linked-thread", "dashboard", "replies", "whiteboard", -======= - "thread", - "linked-thread", ->>>>>>> upstream/main ] as const; export type RightPanelKind = (typeof RIGHT_PANEL_KINDS)[number]; @@ -121,19 +117,16 @@ export type RightPanelSurface = key: string; url?: string; } -<<<<<<< origin/main - | { id: `side-chat:${string}`; kind: "side-chat"; threadId: ThreadId } - | { id: "dashboard"; kind: "dashboard" } - | { id: "replies"; kind: "replies" } - | { id: "whiteboard"; kind: "whiteboard" }; -======= /** * A thread of the panel's environment shown beside it: a side chat or a subagent. Which one is * the thread's own lineage, so the surface only names it. */ | ThreadSurface /** A linked environment's thread, read through `viaEnvironmentId`; it has no thread here. */ - | LinkedThreadSurface; + | LinkedThreadSurface + | { id: "dashboard"; kind: "dashboard" } + | { id: "replies"; kind: "replies" } + | { id: "whiteboard"; kind: "whiteboard" }; export type ThreadSurface = { id: `thread:${string}`; kind: "thread"; threadId: ThreadId }; @@ -152,7 +145,6 @@ export function decodeThreadSurface(surface: object): ThreadSurface | null { if ((kind !== "thread" && kind !== "side-chat") || typeof threadId !== "string") return null; return threadId === "" ? null : threadSurface(ThreadId.make(threadId)); } ->>>>>>> upstream/main const RIGHT_PANEL_STORAGE_KEY = "t3code:right-panel-state:v2"; const RIGHT_PANEL_STORAGE_VERSION = 16; @@ -211,15 +203,11 @@ interface RightPanelStoreState { ) => boolean; open: ( ref: ScopedThreadRef, -<<<<<<< origin/main - kind: Exclude, - automatic?: boolean, -======= kind: Exclude< RightPanelKind, "file" | "terminal" | "pull-request" | "issue" | "thread" | "linked-thread" >, ->>>>>>> upstream/main + automatic?: boolean, ) => void; /** Opens a side chat or subagent of `ref`'s environment as a tab; `ref` itself has no tab. */ openThread: (ref: ScopedThreadRef, threadId: ThreadId) => void; diff --git a/evals/mcp-tool-use/run.ts b/evals/mcp-tool-use/run.ts index 7dcd09d41492..18bf5ad2d6c2 100644 --- a/evals/mcp-tool-use/run.ts +++ b/evals/mcp-tool-use/run.ts @@ -51,13 +51,10 @@ import { projectComposerContextForProvider } from "@t3tools/shared/composerConte import { THEME_GUIDE } from "@t3tools/shared/themeCss"; import { formatThreadLink } from "@t3tools/shared/threadLinks"; import { buildCodexAdditionalContext } from "../../apps/server/src/provider/CodexDeveloperInstructions.ts"; -<<<<<<< origin/main import { isHiddenClaudeTool, withoutCodexSubagentTools } from "./fork/hiddenNativeTools.ts"; import { DashboardToolkit } from "../../apps/server/src/fork/threadDashboard/DashboardTools.ts"; import { SendToUserToolkit } from "../../apps/server/src/fork/userMessageTools/SendToUser.ts"; -======= import { PULL_REQUEST_LINKING_INSTRUCTIONS } from "@t3tools/provider-core/server/runtimeInstructions"; ->>>>>>> upstream/main import { makeSideChatContext } from "../../apps/server/src/orchestration-v2/ContextHandoffService.ts"; import { withInlineContext } from "../../apps/server/src/orchestration-v2/ContextHandoffDelivery.ts"; import { AttachmentToolkit } from "../../apps/server/src/mcp/toolkits/attachment/tools.ts";