{active && effectiveViewport._tag !== "fill" && !fittedSourceViewport ? (
<>
{
).toEqual({ width: 460, height: 409 });
});
});
+
+describe("resolveBrowserViewportTransform", () => {
+ it("keeps a full-detail guest at raster scale 1 while it draws at the fitted scale", () => {
+ expect(resolveBrowserViewportTransform(1, true)).toBeUndefined();
+ expect(resolveBrowserViewportTransform(0.6, false)).toBe("scale(0.6)");
+ const values = resolveBrowserViewportTransform(0.6, true)
+ ?.match(/^matrix3d\((.*)\)$/)?.[1]
+ ?.split(",")
+ .map(Number);
+ // Column-major: the x and y columns keep their 0.6 screen terms and reach length 1 through z.
+ expect(values?.slice(0, 2)).toEqual([0.6, 0]);
+ expect(values?.slice(4, 6)).toEqual([0, 0.6]);
+ expect(Math.hypot(...(values?.slice(0, 3) ?? []))).toBeCloseTo(1);
+ expect(Math.hypot(...(values?.slice(4, 7) ?? []))).toBeCloseTo(1);
+ });
+});
diff --git a/apps/web/src/browser/browserViewportLayout.ts b/apps/web/src/browser/browserViewportLayout.ts
index 2fe4e035100ab..7fe6b170c671d 100644
--- a/apps/web/src/browser/browserViewportLayout.ts
+++ b/apps/web/src/browser/browserViewportLayout.ts
@@ -125,6 +125,22 @@ export function resolveBrowserViewportLayout(
};
}
+/**
+ * Chromium rasters a CSS-scaled guest at its on-screen scale, so captures of it lose detail.
+ * Its raster scale also counts x/y-to-z terms, which a `preserve-3d` parent keeps and the
+ * screen drops, so `fullDetail` draws like `scale()` but keeps full-resolution frames.
+ */
+export function resolveBrowserViewportTransform(
+ scale: number,
+ fullDetail: boolean,
+): string | undefined {
+ if (scale >= 1) return undefined;
+ if (!fullDetail) return `scale(${scale})`;
+ // Positive depth keeps the guest in front of its parent for hit testing.
+ const depth = Math.sqrt(1 - scale * scale);
+ return `matrix3d(${scale}, 0, ${depth}, 0, 0, ${scale}, ${depth}, 0, 0, 0, 1, 0, 0, 0, 0, 1)`;
+}
+
export function resolveBrowserDeviceViewportLayout(
container: { readonly width: number; readonly height: number },
setting: Exclude,
diff --git a/packages/contracts/src/ipc.ts b/packages/contracts/src/ipc.ts
index 8f5258596c5f5..3aa3d7d21fcef 100644
--- a/packages/contracts/src/ipc.ts
+++ b/packages/contracts/src/ipc.ts
@@ -1021,6 +1021,11 @@ export const DesktopPreviewSetShownInputSchema = Schema.Struct({
shown: Schema.Boolean,
});
+export const DesktopPreviewSetCaptureDrawnInputSchema = Schema.Struct({
+ tabId: DesktopPreviewTabIdSchema,
+ drawn: Schema.Boolean,
+});
+
export const DesktopPreviewAnnotationThemeInputSchema = Schema.Struct({
theme: DesktopPreviewAnnotationThemeSchema,
});
@@ -1287,6 +1292,8 @@ export interface DesktopPreviewBridge {
stopFindInPage: (tabId: string) => Promise;
/** Tells the tab's server whether its webview is on screen. */
setShown: (tabId: string, shown: boolean) => Promise;
+ /** Tells the tab's server whether its webview is drawn at full detail for a capture. */
+ setCaptureDrawn: (tabId: string, drawn: boolean) => Promise;
openDevTools: (tabId: string) => Promise;
clearCookies: (environmentId: EnvironmentId, profileId?: string) => Promise;
clearCache: (environmentId: EnvironmentId, profileId?: string) => Promise;
From 7f81aa8386737ecb244e3fd21c95afdb0649aeb7 Mon Sep 17 00:00:00 2001
From: Julius Marminge
Date: Sat, 14 Nov 2026 14:07:43 -0800
Subject: [PATCH 013/140] test(web): pin the minute clock in the sidebar
jump-hint render test (#36954)
---
apps/web/src/components/Sidebar.browser.test.tsx | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/apps/web/src/components/Sidebar.browser.test.tsx b/apps/web/src/components/Sidebar.browser.test.tsx
index f152cabf01851..be674b66520d2 100644
--- a/apps/web/src/components/Sidebar.browser.test.tsx
+++ b/apps/web/src/components/Sidebar.browser.test.tsx
@@ -18,6 +18,7 @@ import { act, fakeTimers, render } from "../../test/render";
import { openCommandPalette } from "../commandPaletteBus";
import { makeThreadFixture } from "../test-fixtures";
import { useHandleNewThread } from "../hooks/useHandleNewThread";
+import { useNowMinute } from "../hooks/useNowMinute";
import { __setClientSettingsForTests, getClientSettings } from "../hooks/useSettings";
import { useThreadRouteTarget } from "../hooks/useThreadRouteTarget";
import { useProjects, useServerConfigs, useQuietThreadShells } from "../state/entities";
@@ -36,6 +37,7 @@ vi.mock(import("../state/olderSettledShelf"), async (original) => {
});
vi.mock("../state/entities", { spy: true });
vi.mock("../hooks/useHandleNewThread", { spy: true });
+vi.mock("../hooks/useNowMinute", { spy: true });
vi.mock("../hooks/useThreadRouteTarget", { spy: true });
vi.mock("./sidebar/SidebarThreadRow", { spy: true });
vi.mock("../state/session", { spy: true });
@@ -144,6 +146,8 @@ describe("sidebar render isolation", () => {
threadId: threads[0]!.id,
};
threads.unshift(threadShell(activeProject.id, 100));
+ // A real wall-clock minute tick mid-test re-renders every row and reads as a leak.
+ vi.mocked(useNowMinute).mockReturnValue("2026-01-01T00:00");
vi.mocked(useProjects).mockReturnValue([activeProject]);
vi.mocked(useQuietThreadShells).mockReturnValue(threads);
vi.mocked(useThreadRouteTarget).mockReturnValue({ kind: "server", threadRef: routeThreadRef });
From 632802cd3243b204e6b17c47b3d7946beb312f21 Mon Sep 17 00:00:00 2001
From: Julius Marminge
Date: Sat, 14 Nov 2026 14:19:58 -0800
Subject: [PATCH 014/140] fix(acp-registry): models show the reasoning levels
the agent advertises for them (#36950)
Co-authored-by: 0xpolarzero <0xpolarzero@gmail.com>
---
packages/contracts/src/acpRegistry.ts | 2 +
.../src/server/driver.test.ts | 38 +++++++++++++++++
.../src/server/driver.ts | 16 +++++--
.../provider-acp-registry/src/server/probe.ts | 42 ++++++++++++++++++-
4 files changed, 93 insertions(+), 5 deletions(-)
diff --git a/packages/contracts/src/acpRegistry.ts b/packages/contracts/src/acpRegistry.ts
index a1d03ef7bd000..c6ecb8862bc4a 100644
--- a/packages/contracts/src/acpRegistry.ts
+++ b/packages/contracts/src/acpRegistry.ts
@@ -268,6 +268,8 @@ export const AcpRegistryProbeModel = Schema.Struct({
id: AcpRegistryProbeText,
name: AcpRegistryProbeText,
description: AcpRegistryProbeDescription,
+ // The reasoning control the agent advertises for this model; null when it has none.
+ reasoningEffort: Schema.optionalKey(Schema.NullOr(ProviderOptionDescriptor)),
});
export type AcpRegistryProbeModel = typeof AcpRegistryProbeModel.Type;
diff --git a/packages/provider-acp-registry/src/server/driver.test.ts b/packages/provider-acp-registry/src/server/driver.test.ts
index 1495cb0bb64dd..ee88901d16905 100644
--- a/packages/provider-acp-registry/src/server/driver.test.ts
+++ b/packages/provider-acp-registry/src/server/driver.test.ts
@@ -271,6 +271,44 @@ describe("acpRegistrySnapshotReadiness", () => {
expect(afterOpus.find((model) => model.slug === "opus")).toMatchObject({
capabilities: { optionDescriptors: [{ id: "thinking" }, { id: "mode" }] },
});
+
+ // Other models take the levels they advertise in `_meta`.
+ const effort = {
+ id: "effort",
+ name: "Effort",
+ category: "thought_level",
+ type: "select" as const,
+ currentValue: "high",
+ options: [{ value: "high", name: "High" }],
+ };
+ const advertised = applyAcpRegistryLiveConfiguration(
+ provider,
+ normalizeAcpRegistryLiveConfiguration([effort], undefined, {
+ currentModelId: "opus",
+ availableModels: [
+ { modelId: "opus", name: "Opus" },
+ {
+ modelId: "haiku",
+ name: "Haiku",
+ _meta: { reasoningEfforts: [{ value: "low", label: "Low" }], reasoningEffort: "low" },
+ },
+ { modelId: "glm", name: "GLM", _meta: { supportsReasoningEffort: false } },
+ ],
+ }),
+ [],
+ ).models.map((model) => model.capabilities?.optionDescriptors ?? []);
+ expect(advertised).toEqual([
+ [{ ...liveOptions[0]!, role: "reasoning" }],
+ [
+ {
+ ...liveOptions[0]!,
+ role: "reasoning",
+ options: [{ id: "low", label: "Low" }],
+ currentValue: "low",
+ },
+ ],
+ [],
+ ]);
});
it("projects discovery without claiming authentication when no login methods are advertised", () => {
diff --git a/packages/provider-acp-registry/src/server/driver.ts b/packages/provider-acp-registry/src/server/driver.ts
index 2db192b9c7f96..726d95a145e91 100644
--- a/packages/provider-acp-registry/src/server/driver.ts
+++ b/packages/provider-acp-registry/src/server/driver.ts
@@ -4,6 +4,7 @@ import {
resolveOfficialAcpRegistryIconUrl,
TextGenerationError,
type AcpRegistryOperationError,
+ type AcpRegistryProbeModel,
type ServerProvider,
type ServerProviderModel,
} from "@t3tools/contracts";
@@ -111,12 +112,19 @@ function modelsFromDiscovery(
(descriptor) => !modelOptionIds.has(descriptor.id),
);
const sharedIds = new Set(shared.map((descriptor) => descriptor.id));
- const capabilitiesFor = (slug: string) => {
+ const capabilitiesFor = ({ id: slug, reasoningEffort }: AcpRegistryProbeModel) => {
if (slug === discovery?.currentModelId) return capabilities;
+ // The levels a model advertises replace the ones an earlier session reported.
const own = (
previousModels.find((model) => model.slug === slug)?.capabilities?.optionDescriptors ?? []
- ).filter((descriptor) => !sharedIds.has(descriptor.id));
- const optionDescriptors = [...shared, ...own];
+ ).filter(
+ (descriptor) =>
+ !sharedIds.has(descriptor.id) &&
+ (reasoningEffort === undefined ||
+ descriptor.type !== "select" ||
+ descriptor.role !== "reasoning"),
+ );
+ const optionDescriptors = [...shared, ...own, ...(reasoningEffort ? [reasoningEffort] : [])];
return optionDescriptors.length === 0
? EMPTY_CAPABILITIES
: createModelCapabilities({ optionDescriptors });
@@ -137,7 +145,7 @@ function modelsFromDiscovery(
name: model.name,
isCustom: false,
...(model.id === discovery?.currentModelId ? { isDefault: true } : {}),
- capabilities: capabilitiesFor(model.id),
+ capabilities: capabilitiesFor(model),
}));
return providerModelsFromSettings(builtInModels, customModels, capabilities);
}
diff --git a/packages/provider-acp-registry/src/server/probe.ts b/packages/provider-acp-registry/src/server/probe.ts
index 2fcf80cbce4d9..662f28783ca45 100644
--- a/packages/provider-acp-registry/src/server/probe.ts
+++ b/packages/provider-acp-registry/src/server/probe.ts
@@ -53,6 +53,39 @@ const boundedText = (value: string, maximumLength: number): string =>
const boundedOpaqueValue = (value: string, maximumLength: number): string | undefined =>
value.length > 0 && value === value.trim() && value.length <= maximumLength ? value : undefined;
+/**
+ * The session's reasoning option with the levels a model advertises in `_meta`, in the
+ * shape Grok uses. Null when the model has none, undefined when it says nothing.
+ */
+function advertisedReasoningEffort(
+ option: EffectAcpSchema.SessionConfigOption | undefined,
+ meta: Readonly> | null | undefined,
+): AcpRegistryProbeModel["reasoningEffort"] {
+ if (option?.type !== "select" || meta == null) return undefined;
+ if (meta.supportsReasoningEffort === false) return null;
+ if (!Array.isArray(meta.reasoningEfforts)) return undefined;
+ const options = meta.reasoningEfforts.flatMap((level: unknown) =>
+ typeof level === "object" &&
+ level !== null &&
+ "value" in level &&
+ typeof level.value === "string"
+ ? [
+ {
+ value: level.value,
+ name: "label" in level && typeof level.label === "string" ? level.label : level.value,
+ },
+ ]
+ : [],
+ );
+ const currentValue = typeof meta.reasoningEffort === "string" ? meta.reasoningEffort : "";
+ return (
+ acpProviderOptionDescriptors({
+ configOptions: [{ ...option, options, currentValue }],
+ modeState: undefined,
+ })[0] ?? null
+ );
+}
+
export function normalizeAcpRegistryWebUrl(value: string): string | undefined {
if (value.length > 2_048 || !URL.canParse(value)) return undefined;
const url = new URL(value);
@@ -195,7 +228,14 @@ export function normalizeAcpRegistryLiveConfiguration(
currentModelId === undefined
? null
: (boundedOpaqueValue(currentModelId, MAX_ID_LENGTH) ?? null);
- const models = normalizeModels(candidates, boundedCurrentModelId);
+ const effortOption = configOptions.find((option) => option.category === "thought_level");
+ const models = normalizeModels(candidates, boundedCurrentModelId).map((model) => {
+ const reasoningEffort = advertisedReasoningEffort(
+ effortOption,
+ modelState?.availableModels.find((info) => info.modelId === model.id)?._meta,
+ );
+ return reasoningEffort === undefined ? model : { ...model, reasoningEffort };
+ });
const descriptors = acpProviderOptionDescriptors({ configOptions, modeState });
const modelOptionIds = new Set(
configOptions
From cbdf35f2f0bcee887abc7736236293a67658a45e Mon Sep 17 00:00:00 2001
From: Victor
Date: Sat, 14 Nov 2026 16:29:15 -0600
Subject: [PATCH 015/140] fix(web): enable Send when the composer holds only a
thread context (#23166)
Co-authored-by: Julius Marminge
---
apps/web/src/components/chat/ChatComposer.tsx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx
index e25ccc6dd25e8..978bab1d1e1ca 100644
--- a/apps/web/src/components/chat/ChatComposer.tsx
+++ b/apps/web/src/components/chat/ChatComposer.tsx
@@ -1102,7 +1102,11 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
imageCount: composerImages.length + composerFiles.length,
existingAttachmentCount: editingQueuedAttachments?.length ?? 0,
terminalContexts: composerTerminalContexts,
- elementContextCount: composerPreviewAnnotations.length + composerReviewComments.length,
+ elementContextCount:
+ composerPreviewAnnotations.length +
+ composerReviewComments.length +
+ composerThreadContexts.length +
+ composerEnvironmentContexts.length,
});
const composerTriggerKind = composerTrigger?.kind ?? null;
const compactSlashCommandAvailable =
From d080e4eb587898c5057d03b3c7148d113ddeccc3 Mon Sep 17 00:00:00 2001
From: Andrei <108398860+Yuruzuu@users.noreply.github.com>
Date: Sun, 15 Nov 2026 06:30:30 +0800
Subject: [PATCH 016/140] fix(web): thread details card no longer jumps mid
panel animation (#22614)
Co-authored-by: maria-rcks
Co-authored-by: Julius Marminge
---
apps/web/src/components/chat/ChatCanvas.tsx | 71 ++++++++++++++++++-
.../src/components/chat/canvasStore.test.ts | 8 ++-
apps/web/src/components/chat/canvasStore.ts | 4 ++
.../components/chat/chatCanvasLayout.test.ts | 14 ++++
.../chat/threadDetailsCardLayout.ts | 9 ++-
5 files changed, 101 insertions(+), 5 deletions(-)
diff --git a/apps/web/src/components/chat/ChatCanvas.tsx b/apps/web/src/components/chat/ChatCanvas.tsx
index e05d3befcc138..7848009308750 100644
--- a/apps/web/src/components/chat/ChatCanvas.tsx
+++ b/apps/web/src/components/chat/ChatCanvas.tsx
@@ -7,6 +7,41 @@ import { selectThreadPanelOpen, useRightPanelStore } from "../../rightPanelStore
import { observeResize } from "../../lib/observeResize";
import type { ScopedThreadRef } from "@t3tools/contracts";
+function panelWidthTransitions(element: HTMLElement) {
+ const panels = element
+ .closest("[data-panel-animations]")
+ ?.querySelectorAll('[data-slot="sidebar-gap"], [data-preview-panel-mode="inline"]');
+ return Array.from(panels ?? []).flatMap((panel) =>
+ panel
+ .getAnimations()
+ .filter(
+ (animation): animation is CSSTransition =>
+ animation instanceof CSSTransition &&
+ animation.transitionProperty === "width" &&
+ animation.playState === "running",
+ ),
+ );
+}
+
+// Sample only the layout panels; seeking unrelated transitions can change their lifecycle.
+function measureTransitionWidths(element: HTMLElement, transitions: CSSTransition[]) {
+ if (transitions.length === 0) return null;
+ const times = transitions.map((animation) => animation.currentTime);
+ // Opposite panel transitions can reach their widest points at different times.
+ for (const animation of transitions) {
+ const end = Number(animation.effect?.getComputedTiming().endTime ?? 0);
+ animation.currentTime = 0;
+ const startWidth = element.clientWidth;
+ animation.currentTime = end;
+ if (startWidth < element.clientWidth) animation.currentTime = 0;
+ }
+ const narrowestWidth = element.clientWidth;
+ transitions.forEach((animation, index) => {
+ animation.currentTime = times[index] ?? null;
+ });
+ return { transitions, narrowestWidth };
+}
+
export function ChatCanvas({
store,
threadRef,
@@ -36,7 +71,34 @@ export function ChatCanvas({
if (!element || !probe) return;
const findBar =
detailsCardTopInset > 0 ? element.querySelector("[data-thread-find-bar]") : null;
+ let disposed = false;
+ // Seeking forces layout, so it runs once when a transition starts, not every frame.
+ let transitionWidths: ReturnType = null;
const measure = () => {
+ const width = element.clientWidth;
+ const transitions = panelWidthTransitions(element);
+ if (
+ transitions.length !== (transitionWidths?.transitions.length ?? 0) ||
+ transitions.some((animation, index) => animation !== transitionWidths?.transitions[index])
+ ) {
+ const settling = measureTransitionWidths(element, transitions);
+ if (settling && transitionWidths) {
+ settling.narrowestWidth = Math.min(
+ settling.narrowestWidth,
+ transitionWidths.narrowestWidth,
+ );
+ }
+ transitionWidths = settling;
+ // The last resize can arrive while the transitions still count as running.
+ if (settling) {
+ void Promise.allSettled(settling.transitions.map((animation) => animation.finished)).then(
+ () => {
+ if (disposed || transitionWidths !== settling) return;
+ measure();
+ },
+ );
+ }
+ }
const canvasBounds = element.getBoundingClientRect();
const findBarBounds = findBar?.getBoundingClientRect();
const styles = getComputedStyle(probe);
@@ -49,7 +111,8 @@ export function ChatCanvas({
bottom: findBarBounds ? findBarBounds.bottom - canvasBounds.top : 0,
}
: null,
- width: element.clientWidth,
+ width,
+ narrowestWidth: transitionWidths?.narrowestWidth ?? width,
height: element.clientHeight,
padding: Number.parseFloat(styles.paddingLeft),
maxChatWidth: Number.parseFloat(styles.width),
@@ -65,7 +128,11 @@ export function ChatCanvas({
if (findBar) observed.push(findBar);
if (composerOverlayElement) observed.push(composerOverlayElement);
if (timelineElement) observed.push(timelineElement);
- return observeResize(observed, measure);
+ const stopObserving = observeResize(observed, measure);
+ return () => {
+ disposed = true;
+ stopObserving();
+ };
}, [store, composerOverlayElement, timelineElement, detailsCardTopInset]);
const detailsCardInlineOpen = useRightPanelStore((state) =>
threadRef === null
diff --git a/apps/web/src/components/chat/canvasStore.test.ts b/apps/web/src/components/chat/canvasStore.test.ts
index ad2fe38b044ba..c7620f1db5c87 100644
--- a/apps/web/src/components/chat/canvasStore.test.ts
+++ b/apps/web/src/components/chat/canvasStore.test.ts
@@ -31,9 +31,9 @@ const preview: ChatCanvasPreview = {
describe("chat canvas model", () => {
it("shows the details card inline only where the canvas fits it beside the chat", () => {
- const resolve = (width: number) =>
+ const resolve = (width: number, narrowestWidth = width) =>
resolveChatCanvasModel({
- measurements: measurements(width),
+ measurements: { ...measurements(width), narrowestWidth },
detailsCardMeasurement: null,
threadRef,
preview: null,
@@ -41,6 +41,7 @@ describe("chat canvas model", () => {
}).detailsCardMode;
expect(resolve(1400)).toBe("inline");
expect(resolve(900)).toBe("popover");
+ expect(resolve(1400, 900)).toBe("popover");
});
it("moves the card into a popover when a preview below it leaves too little height", () => {
@@ -79,5 +80,8 @@ describe("chat canvas model", () => {
store.getState().measureDetailsCard({ threadRef, width: 280, fullContentHeight: 300 });
expect(measured.measurements).toBe(before.measurements);
expect(store.getState()).toBe(measured);
+ store.getState().setMeasurements({ ...measurements(1400), narrowestWidth: 900 });
+ expect(store.getState().measurements.narrowestWidth).toBe(900);
+ expect(store.getState()).not.toBe(measured);
});
});
diff --git a/apps/web/src/components/chat/canvasStore.ts b/apps/web/src/components/chat/canvasStore.ts
index 76fb540dc5d41..6b350cf95f22f 100644
--- a/apps/web/src/components/chat/canvasStore.ts
+++ b/apps/web/src/components/chat/canvasStore.ts
@@ -13,6 +13,7 @@ interface CanvasEdges {
export interface ChatCanvasMeasurements {
readonly width: number;
+ readonly narrowestWidth?: number;
readonly height: number;
readonly padding: number;
readonly maxChatWidth: number;
@@ -47,6 +48,7 @@ const sameEdges = (a: CanvasEdges | null, b: CanvasEdges | null) =>
const sameMeasurements = (a: ChatCanvasMeasurements, b: ChatCanvasMeasurements) =>
a.width === b.width &&
+ a.narrowestWidth === b.narrowestWidth &&
a.height === b.height &&
a.padding === b.padding &&
a.maxChatWidth === b.maxChatWidth &&
@@ -101,6 +103,7 @@ export function resolveChatCanvasModel({
// preview overlap has pushed the card itself into popover mode.
const preferredDetailsCard = resolveThreadDetailsCardLayout({
container,
+ narrowestWidth: measurements.narrowestWidth ?? measurements.width,
lane,
frame: null,
topInset: detailsCardTopInset,
@@ -139,6 +142,7 @@ export function resolveChatCanvasModel({
});
const detailsCardPlacement = resolveThreadDetailsCardLayout({
container,
+ narrowestWidth: measurements.narrowestWidth ?? measurements.width,
lane,
frame: layout.frame,
overlapsDetailsCard: layout.overlapsDetailsCard,
diff --git a/apps/web/src/components/chat/chatCanvasLayout.test.ts b/apps/web/src/components/chat/chatCanvasLayout.test.ts
index 748d8abb5d1ac..2f9e82a9e600b 100644
--- a/apps/web/src/components/chat/chatCanvasLayout.test.ts
+++ b/apps/web/src/components/chat/chatCanvasLayout.test.ts
@@ -357,4 +357,18 @@ describe("workspace card beside chat", () => {
expect(card.x - chat.left - chat.width).toBeGreaterThanOrEqual(32);
}
});
+ it("stays out of a panel animation that ends or starts too narrow for it", () => {
+ const place = (width: number, narrowestWidth: number) =>
+ resolveThreadDetailsCardLayout({
+ container: { width, height: 900 },
+ narrowestWidth,
+ lane: { padding: 48, minChatWidth: 640 },
+ frame: null,
+ });
+ expect(place(1344, 1344)).toMatchObject({ x: 1052 });
+ expect(place(1344, 804)).toBeNull();
+ expect(place(1344, 1124)).toMatchObject({ x: 1052 });
+ // A window resize mid-animation leaves the sampled ends wider than the canvas.
+ expect(place(900, 1344)).toBeNull();
+ });
});
diff --git a/apps/web/src/components/chat/threadDetailsCardLayout.ts b/apps/web/src/components/chat/threadDetailsCardLayout.ts
index 7b5e1be8f29b3..a84098fb720ca 100644
--- a/apps/web/src/components/chat/threadDetailsCardLayout.ts
+++ b/apps/web/src/components/chat/threadDetailsCardLayout.ts
@@ -16,12 +16,15 @@ export function resolveThreadDetailsCardDensity(
export function resolveThreadDetailsCardLayout({
container,
+ narrowestWidth = container.width,
lane,
frame,
overlapsDetailsCard = false,
topInset = 0,
}: {
container: { width: number; height: number };
+ // While a panel animates the container, the card fits only if it fits at both ends.
+ narrowestWidth?: number;
lane: { padding: number; minChatWidth: number };
frame: PreviewMiniPlayerFrame | null;
overlapsDetailsCard?: boolean;
@@ -30,7 +33,11 @@ export function resolveThreadDetailsCardLayout({
const gap = THREAD_DETAILS_CARD_GAP;
const width = THREAD_DETAILS_CARD_WIDTH;
const x = container.width - width - gap;
- if (x - DETAILS_CARD_CLEARANCE - lane.padding < lane.minChatWidth) return null;
+ // The transition ends are sampled once, so a resize mid-animation can leave them
+ // wider than the container is now.
+ const fitWidth = Math.min(narrowestWidth, container.width);
+ if (fitWidth - width - gap - DETAILS_CARD_CLEARANCE - lane.padding < lane.minChatWidth)
+ return null;
const y = gap + topInset;
const height =
overlapsDetailsCard && frame && frame.x + frame.width > x - gap && frame.x < x + width + gap
From 20ff8e7173b5b52c9c7dc7709ec285ec685093ff Mon Sep 17 00:00:00 2001
From: BelKed <66956532+BelKed@users.noreply.github.com>
Date: Sat, 14 Nov 2026 23:32:52 +0100
Subject: [PATCH 017/140] fix(desktop): hold page dialogs from guest attach
---
apps/desktop/src/preview/Manager.test.ts | 41 +++++++++++++++++++-
apps/desktop/src/preview/Manager.ts | 30 ++++++++------
apps/desktop/src/preview/PageDialogs.test.ts | 15 -------
apps/desktop/src/preview/PageDialogs.ts | 23 +++++------
4 files changed, 67 insertions(+), 42 deletions(-)
diff --git a/apps/desktop/src/preview/Manager.test.ts b/apps/desktop/src/preview/Manager.test.ts
index bbb0ef073078f..03ec0f6118e5b 100644
--- a/apps/desktop/src/preview/Manager.test.ts
+++ b/apps/desktop/src/preview/Manager.test.ts
@@ -1712,8 +1712,9 @@ describe("PreviewManager", () => {
),
);
- const makeAudioWebContents = (id: number) => {
+ const makeAudioWebContents = (id: number, nativeDialog?: (...args: never[]) => void) => {
const listeners = new Map void>();
+ if (nativeDialog) listeners.set("-run-dialog", nativeDialog);
let debuggerMessage: ((...args: ReadonlyArray) => void) | undefined;
const setAudioMuted = vi.fn();
let audible = false;
@@ -1766,7 +1767,8 @@ describe("PreviewManager", () => {
navigationHistory: { canGoBack: () => false, canGoForward: () => false },
setIgnoreMenuShortcuts: vi.fn(),
setWindowOpenHandler: vi.fn(),
- listeners: () => [],
+ listeners: (event: string) =>
+ event === "-run-dialog" && nativeDialog ? [nativeDialog] : [],
debugger: {
isAttached: () => false,
attach: vi.fn(),
@@ -1823,6 +1825,7 @@ describe("PreviewManager", () => {
}),
);
yield* manager.createTab("tab_dialog");
+ yield* manager.prepareWebview(guest.wc);
yield* manager.registerWebview("tab_dialog", 42);
yield* Effect.yieldNow;
@@ -1853,6 +1856,7 @@ describe("PreviewManager", () => {
yield* Effect.yieldNow;
const replacement = makeAudioWebContents(43);
fromId.mockReturnValue(replacement.wc);
+ yield* manager.prepareWebview(replacement.wc);
yield* manager.registerWebview("tab_dialog", 43);
yield* Effect.yieldNow;
expect(states.at(-1)?.dialog).toBeUndefined();
@@ -1873,6 +1877,39 @@ describe("PreviewManager", () => {
),
);
+ effectIt.effect("holds a page dialog raised before the guest is registered", () =>
+ withManager((manager) =>
+ Effect.gen(function* () {
+ const native = vi.fn();
+ const guest = makeAudioWebContents(45, native);
+ fromId.mockReturnValue(guest.wc);
+ const states: PreviewManager.PreviewTabState[] = [];
+ const answer = vi.fn();
+
+ yield* manager.subscribeStateChanges((_tabId, state) =>
+ Effect.sync(() => {
+ states.push(state);
+ }),
+ );
+ yield* manager.createTab("tab_dialog_early");
+ yield* manager.prepareWebview(guest.wc);
+ guest.emit(
+ "-run-dialog",
+ { dialogType: "alert", messageText: "Hi", defaultPromptText: "" },
+ answer,
+ );
+ yield* manager.registerWebview("tab_dialog_early", 45);
+ yield* Effect.yieldNow;
+
+ expect(native).not.toHaveBeenCalled();
+ expect(states.at(-1)?.dialog).toEqual({ type: "alert", message: "Hi", defaultValue: "" });
+
+ yield* manager.answerDialog("tab_dialog_early", true, undefined);
+ expect(answer).toHaveBeenCalledExactlyOnceWith(true, "");
+ }),
+ ),
+ );
+
effectIt.effect("ignores audio state from a replaced guest", () =>
withManager((manager) =>
Effect.gen(function* () {
diff --git a/apps/desktop/src/preview/Manager.ts b/apps/desktop/src/preview/Manager.ts
index a2c9077849886..caa15fd4cab53 100644
--- a/apps/desktop/src/preview/Manager.ts
+++ b/apps/desktop/src/preview/Manager.ts
@@ -965,16 +965,14 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
});
const syncTabDialog = Effect.fn("PreviewManager.syncTabDialog")(function* (
- tabId: string,
wc: Electron.WebContents,
dialog: DesktopPreviewDialog | null,
) {
const updatedAt = yield* currentIso;
const next = yield* SynchronizedRef.modify(tabsRef, (tabs) => {
- const current = tabs.get(tabId);
- if (!current || current.webContentsId !== wc.id) {
- return [Option.none(), tabs] as const;
- }
+ const entry = [...tabs].find(([, tab]) => tab.webContentsId === wc.id);
+ if (!entry) return [Option.none(), tabs] as const;
+ const [tabId, current] = entry;
const { dialog: _dialog, ...withoutDialog } = current;
const state: PreviewTabState = {
...withoutDialog,
@@ -982,15 +980,23 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
updatedAt,
};
return [
- Option.some(state),
+ Option.some([tabId, state] as const),
replaceMap(tabs, (copy) => {
copy.set(tabId, state);
}),
] as const;
});
- if (Option.isSome(next)) yield* emitIfCurrent(tabId, next.value);
+ if (Option.isSome(next)) yield* emitIfCurrent(next.value[0], next.value[1]);
});
+ const ensureDialogHold = (wc: Electron.WebContents) => {
+ if (dialogHolds.has(wc.id)) return;
+ dialogHolds.set(
+ wc.id,
+ holdPageDialogs(wc, (dialog) => runFork(syncTabDialog(wc, dialog))),
+ );
+ };
+
const requireWebContents = Effect.fn("PreviewManager.requireWebContents")(function* (
tabId: string,
) {
@@ -1230,7 +1236,6 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
const scope = yield* Scope.fork(parentScope, "sequential");
const attachmentId = Symbol();
let detachPasskeys = () => {};
- let dialogHold: PageDialogHold | undefined;
let documentId = 0;
let nextRequestId = 0;
let activeCapture: {
@@ -1687,8 +1692,7 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
wc.ipc.off(RECORDING_INPUT_CHANNEL, recordingInput);
wc.ipc.off(PAGE_UNHANDLED_SHORTCUT_CHANNEL, pageUnhandledShortcut);
detachPasskeys();
- if (dialogHolds.get(wc.id) === dialogHold) dialogHolds.delete(wc.id);
- dialogHold?.release();
+ dialogHolds.get(wc.id)?.answer(false);
}).pipe(Effect.ignore),
);
const install = Effect.fn("PreviewManager.installWebContentsListeners")(function* () {
@@ -1705,8 +1709,6 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
wc.on("did-fail-load", failed as never);
wc.on("audio-state-changed", audioStateChanged);
wc.on("found-in-page", foundInPage as never);
- dialogHold = holdPageDialogs(wc, (dialog) => runFork(syncTabDialog(tabId, wc, dialog)));
- dialogHolds.set(wc.id, dialogHold);
wc.ipc.on(HUMAN_INPUT_CHANNEL, humanInput);
wc.ipc.on(RECORDING_INPUT_CHANNEL, recordingInput);
wc.ipc.on(PAGE_UNHANDLED_SHORTCUT_CHANNEL, pageUnhandledShortcut);
@@ -2002,8 +2004,10 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
const pendingUrl = current.navStatus.kind === "Loading" ? current.navStatus.url : null;
const failure = guestLoadFailures.get(webContentsId);
const { favicon: _favicon, dialog: _dialog, ...currentWithoutFavicon } = current;
+ const pendingDialog = dialogHolds.get(webContentsId)?.current();
const next: PreviewTabState = {
...currentWithoutFavicon,
+ ...(pendingDialog ? { dialog: pendingDialog } : {}),
webContentsId,
navStatus:
failure && (pendingUrl === null || pendingUrl === failure.url)
@@ -2078,6 +2082,7 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
) {
yield* rendererHistory.register(wc, { surface: "preview" });
const webContentsId = wc.id;
+ ensureDialogHold(wc);
wc.on("did-start-navigation", (event) => {
if (event.isMainFrame && !event.isSameDocument) guestLoadFailures.delete(webContentsId);
});
@@ -2092,6 +2097,7 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
wc.once("destroyed", () => {
guestLoadFailures.delete(webContentsId);
dialogHolds.get(webContentsId)?.closed();
+ dialogHolds.delete(webContentsId);
runFork(hideDestroyedGuest(webContentsId));
runFork(detachControlSession(webContentsId));
});
diff --git a/apps/desktop/src/preview/PageDialogs.test.ts b/apps/desktop/src/preview/PageDialogs.test.ts
index 88f9bf31f53d4..c702b444c6298 100644
--- a/apps/desktop/src/preview/PageDialogs.test.ts
+++ b/apps/desktop/src/preview/PageDialogs.test.ts
@@ -61,19 +61,4 @@ describe("holdPageDialogs", () => {
expect(hold.answer(true)).toBe(false);
expect(callback).not.toHaveBeenCalled();
});
-
- it("dismisses a pending dialog and hands the native handler back on release", () => {
- const { contents, native, changed, hold, callback } = setup();
- contents.emit("-run-dialog", info, callback);
- callback.mockImplementation(() => {
- throw new Error("callback already used");
- });
-
- hold.release();
-
- expect(callback).toHaveBeenCalledWith(false, "");
- expect(changed).toHaveBeenLastCalledWith(null);
- contents.emit("-run-dialog", info, vi.fn());
- expect(native).toHaveBeenCalledOnce();
- });
});
diff --git a/apps/desktop/src/preview/PageDialogs.ts b/apps/desktop/src/preview/PageDialogs.ts
index 08c7a86331676..96d9feb538f13 100644
--- a/apps/desktop/src/preview/PageDialogs.ts
+++ b/apps/desktop/src/preview/PageDialogs.ts
@@ -13,7 +13,7 @@ export interface PageDialogHold {
readonly answer: (accept: boolean, promptText?: string) => boolean;
/** Forgets the pending dialog after something else, such as CDP, closed it. */
readonly closed: () => void;
- readonly release: () => void;
+ readonly current: () => DesktopPreviewDialog | null;
}
// Electron shows page dialogs as a native app-modal box from the `-run-dialog` event and never
@@ -22,11 +22,12 @@ export function holdPageDialogs(
contents: NodeJS.EventEmitter,
changed: (dialog: DesktopPreviewDialog | null) => void,
): PageDialogHold {
- const native = contents.listeners("-run-dialog") as Array<(...args: unknown[]) => void>;
let pending: DialogCallback | null = null;
+ let shown: DesktopPreviewDialog | null = null;
const clear = () => {
if (pending === null) return;
pending = null;
+ shown = null;
changed(null);
};
const deliver = (callback: DialogCallback, accept: boolean, userInput: string) => {
@@ -41,13 +42,16 @@ export function holdPageDialogs(
const previous = pending;
if (previous !== null) deliver(previous, false, "");
pending = callback;
- changed({
+ shown = {
type: info.dialogType,
message: info.messageText,
defaultValue: info.defaultPromptText,
- });
+ };
+ changed(shown);
};
- for (const listener of native) contents.off("-run-dialog", listener);
+ for (const listener of contents.listeners("-run-dialog")) {
+ contents.off("-run-dialog", listener as (...args: unknown[]) => void);
+ }
contents.on("-run-dialog", run);
contents.on("-cancel-dialogs", clear);
return {
@@ -58,13 +62,6 @@ export function holdPageDialogs(
return deliver(callback, accept, promptText ?? "");
},
closed: clear,
- release: () => {
- const callback = pending;
- clear();
- if (callback !== null) deliver(callback, false, "");
- contents.off("-run-dialog", run);
- contents.off("-cancel-dialogs", clear);
- for (const listener of native) contents.on("-run-dialog", listener);
- },
+ current: () => shown,
};
}
From 2dd810d0f609415a205af637f9e6983dfb5785b1 Mon Sep 17 00:00:00 2001
From: Julius Marminge
Date: Sat, 14 Nov 2026 14:33:08 -0800
Subject: [PATCH 018/140] fix(web,mobile): /btw and /side drafts show the send
arrow while a turn runs (#36932)
---
apps/mobile/src/features/threads/ThreadComposer.tsx | 8 +++++++-
apps/mobile/src/features/threads/ThreadDetailScreen.tsx | 4 ++++
apps/web/src/components/chat/ChatComposer.tsx | 8 ++++++--
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/apps/mobile/src/features/threads/ThreadComposer.tsx b/apps/mobile/src/features/threads/ThreadComposer.tsx
index fe4393a97bddf..fdd6b414a46e5 100644
--- a/apps/mobile/src/features/threads/ThreadComposer.tsx
+++ b/apps/mobile/src/features/threads/ThreadComposer.tsx
@@ -30,6 +30,7 @@ import {
hasProviderUsageLimits,
isUsageLimitsCommand,
} from "@t3tools/shared/usageLimits";
+import { parseSideChatCommand } from "@t3tools/shared/composerTrigger";
import { StackActions, useFocusEffect, useNavigation } from "@react-navigation/native";
import type { ReactNode } from "react";
import { useEffect, useEffectEvent, useRef, useState, type RefObject } from "react";
@@ -236,6 +237,8 @@ export interface ThreadComposerProps {
readonly serverConfig: T3ServerConfig | null;
readonly queueCount: number;
readonly activeThreadBusy: boolean;
+ /** Sending declines a pending approval and redirects the agent, so `/side` is plain text. */
+ readonly redirectsApproval: boolean;
readonly canStopThread: boolean;
readonly environmentId: EnvironmentId;
readonly projectCwd: string | null;
@@ -499,7 +502,10 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
});
const sendPresentation = resolveComposerSendPresentation({
editingQueuedMessage: queuedEdit !== null,
- running: props.activeThreadBusy,
+ // A side-chat command starts a side chat; it never queues or steers the running turn.
+ running:
+ props.activeThreadBusy &&
+ (props.redirectsApproval || parseSideChatCommand(draftMessage) === null),
canSteer: props.canSteerActiveTurn,
followUpBehavior: props.followUpBehavior,
deliveryDeferred:
diff --git a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx
index 12805a1483429..73b985fc20144 100644
--- a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx
+++ b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx
@@ -1890,6 +1890,10 @@ function ThreadDetailBody(
serverConfig={props.serverConfig}
queueCount={props.selectedThreadQueueCount}
activeThreadBusy={props.activeThreadBusy}
+ redirectsApproval={
+ props.activePendingApprovals.length > 0 &&
+ props.activePendingUserInput === null
+ }
canStopThread={props.canStopThread}
environmentId={props.environmentId}
projectCwd={props.threadCwd ?? props.projectWorkspaceRoot}
diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx
index 978bab1d1e1ca..77dce596892d5 100644
--- a/apps/web/src/components/chat/ChatComposer.tsx
+++ b/apps/web/src/components/chat/ChatComposer.tsx
@@ -53,7 +53,7 @@ import * as Schema from "effect/Schema";
import { formatComposerModelMention } from "@t3tools/client-runtime/composer-model-mentions";
import { isPasteAsTextShortcut } from "@t3tools/client-runtime/text-paste";
import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime/environment";
-import { serializeComposerFileLink } from "@t3tools/shared/composerTrigger";
+import { parseSideChatCommand, serializeComposerFileLink } from "@t3tools/shared/composerTrigger";
import { type FolderDropTarget, folderDropTarget, resolveDroppedFolderPath } from "./folderDrop";
import { splitTransferredFiles } from "./workspaceFileDrop";
import { createModelSelection, normalizeModelSlug } from "@t3tools/shared/model";
@@ -3731,7 +3731,11 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
compact={isComposerPrimaryActionsCompact}
canOperateThread={canOperateThread}
pendingAction={pendingPrimaryAction}
- isRunning={phase === "running" || phase === "connecting"}
+ // A side-chat command starts a side chat; it never queues or steers the turn.
+ isRunning={
+ (phase === "running" || phase === "connecting") &&
+ !(props.sideChatAvailable === true && parseSideChatCommand(prompt) !== null)
+ }
canInterrupt={canInterrupt}
runId={activeThread?.runtime?.activeRunId ?? null}
followUpBehavior={followUpBehavior}
From ab2bf940f620f4ddf920588eb6c6cc88f2e67428 Mon Sep 17 00:00:00 2001
From: Advait Paliwal
Date: Sat, 14 Nov 2026 17:33:20 -0500
Subject: [PATCH 019/140] fix(server): migrated databases can return freed
space to disk (#30066)
Co-authored-by: maria-rcks
Co-authored-by: Julius Marminge
---
.../persistence/initializeV2Database.test.ts | 4 +-
.../src/persistence/initializeV2Database.ts | 39 +++++++++++++------
2 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/apps/server/src/persistence/initializeV2Database.test.ts b/apps/server/src/persistence/initializeV2Database.test.ts
index f8c68f49ceb9a..aa8357542e927 100644
--- a/apps/server/src/persistence/initializeV2Database.test.ts
+++ b/apps/server/src/persistence/initializeV2Database.test.ts
@@ -132,7 +132,7 @@ it.effect("includes committed WAL data and does not publish a failed snapshot",
const source = new NodeSqlite.DatabaseSync(sourcePath);
try {
source.exec(
- "PRAGMA journal_mode=WAL; CREATE TABLE messages(text TEXT); INSERT INTO messages VALUES ('committed'); BEGIN; INSERT INTO messages VALUES ('uncommitted');",
+ "PRAGMA journal_mode=WAL; CREATE TABLE messages(text TEXT); INSERT INTO messages VALUES ('committed'); CREATE TABLE dropped(blob BLOB); INSERT INTO dropped VALUES (randomblob(65536)); DROP TABLE dropped; BEGIN; INSERT INTO messages VALUES ('uncommitted');",
);
yield* initializeV2Database(destinationPath);
const copy = new NodeSqlite.DatabaseSync(destinationPath, { readOnly: true });
@@ -144,6 +144,8 @@ it.effect("includes committed WAL data and does not publish a failed snapshot",
.map((row) => row.text),
["committed"],
);
+ assert.deepEqual(copy.prepare("PRAGMA auto_vacuum").get(), { auto_vacuum: 2 });
+ assert.deepEqual(copy.prepare("PRAGMA freelist_count").get(), { freelist_count: 0 });
} finally {
copy.close();
}
diff --git a/apps/server/src/persistence/initializeV2Database.ts b/apps/server/src/persistence/initializeV2Database.ts
index 492567c7980da..1a9f4bac55543 100644
--- a/apps/server/src/persistence/initializeV2Database.ts
+++ b/apps/server/src/persistence/initializeV2Database.ts
@@ -1,4 +1,4 @@
-import * as NodeSqlite from "node:sqlite";
+import * as NodeWorkerThreads from "node:worker_threads";
import * as Effect from "effect/Effect";
import * as FileSystem from "effect/FileSystem";
@@ -26,6 +26,20 @@ const isProcessAlive = (pid: number): boolean => {
}
};
+// V1 files predate auto_vacuum, and a page backup would keep that. VACUUM INTO compacts the copy and
+// enables incremental mode, so the server can return freed pages; the worker keeps it off the event loop.
+const snapshotWorkerSource = `
+const { workerData } = require("node:worker_threads");
+const { DatabaseSync } = require("node:sqlite");
+const database = new DatabaseSync(workerData.sourcePath, { readOnly: true });
+try {
+ database.exec("PRAGMA auto_vacuum = INCREMENTAL");
+ database.prepare("VACUUM INTO ?").run(workerData.snapshotPath);
+} finally {
+ database.close();
+}
+`;
+
// Legacy names have no PID; newer copies stay while their process is alive.
const removeAbandonedCopies = Effect.fn("removeAbandonedCopies")(function* (directory: string) {
const fs = yield* FileSystem.FileSystem;
@@ -60,16 +74,19 @@ export const initializeV2Database = Effect.fn("initializeV2Database")(function*
prefix: `.v2-import-${process.pid}-`,
});
const snapshotPath = path.join(temporaryDirectory, "snapshot.sqlite");
- yield* Effect.tryPromise({
- try: async () => {
- const database = new NodeSqlite.DatabaseSync(sourcePath, { readOnly: true });
- try {
- await NodeSqlite.backup(database, snapshotPath);
- } finally {
- database.close();
- }
- },
- catch: (cause) => new V2DatabaseImportError({ sourcePath, destinationPath, cause }),
+ yield* Effect.callback((resume) => {
+ const fail = (cause: unknown) =>
+ resume(Effect.fail(new V2DatabaseImportError({ sourcePath, destinationPath, cause })));
+ const worker = new NodeWorkerThreads.Worker(snapshotWorkerSource, {
+ eval: true,
+ workerData: { sourcePath, snapshotPath },
+ });
+ worker.once("error", fail);
+ worker.once("exit", (code) =>
+ code === 0 ? resume(Effect.void) : fail(new Error(`Snapshot worker exited with ${code}`)),
+ );
+ // Interruption waits for the worker to exit before the scope removes its directory.
+ return Effect.promise(() => worker.terminate());
});
// Publish only a complete snapshot, without replacing an existing V2 database.
yield* fs.link(snapshotPath, destinationPath).pipe(
From 88c42f471b0ccebb9d404e334b2179664fc22239 Mon Sep 17 00:00:00 2001
From: Hirbod <504909+hirbod@users.noreply.github.com>
Date: Sat, 14 Nov 2026 22:38:10 +0000
Subject: [PATCH 020/140] fix(devices): rename EAS Simulator to Expo Simulators
(#36951)
---
apps/server/graphql.config.ts | 2 +-
apps/server/src/device/DeviceHost.ts | 2 +-
apps/server/src/device/DeviceHubProxy.ts | 2 +-
apps/server/src/device/DeviceService.test.ts | 2 +-
apps/server/src/device/DeviceService.ts | 6 +--
apps/server/src/device/EasDeviceHost.test.ts | 12 +++---
apps/server/src/device/EasDeviceHost.ts | 42 ++++++++++---------
apps/server/src/device/ExpoApi.test.ts | 2 +-
apps/server/src/device/ExpoApi.ts | 4 +-
apps/server/src/device/easProjectId.test.ts | 2 +-
apps/server/src/device/easProjectId.ts | 4 +-
.../src/device/localSshDeviceHost.test.ts | 2 +-
apps/server/src/mcp/McpDeviceToolkit.test.ts | 2 +-
.../src/mcp/toolkits/device/handlers.ts | 4 +-
apps/server/src/mcp/toolkits/device/tools.ts | 2 +-
apps/server/src/serverSettings.test.ts | 6 +--
apps/server/src/settingsSecrets.ts | 2 +-
.../web/src/components/device/DeviceSetup.tsx | 2 +-
.../src/components/device/DeviceWorkspace.tsx | 2 +-
.../settings/DeviceSourcesSettings.tsx | 8 ++--
.../settings/EasDeviceHostEditor.tsx | 12 +++---
.../settings/SecretsSettings.logic.test.ts | 4 +-
.../easDeviceHostsSettings.logic.test.ts | 4 +-
.../settings/easDeviceHostsSettings.logic.ts | 4 +-
apps/web/src/state/device.ts | 2 +-
docs/internals/devices.md | 12 +++---
docs/user/devices.md | 2 +-
packages/client-runtime/src/device/stream.ts | 4 +-
packages/client-runtime/src/state/device.ts | 4 +-
packages/contracts/src/device.test.ts | 18 ++++----
packages/contracts/src/device.ts | 22 +++++-----
packages/contracts/src/settings.test.ts | 8 ++--
32 files changed, 104 insertions(+), 102 deletions(-)
diff --git a/apps/server/graphql.config.ts b/apps/server/graphql.config.ts
index f042d039410db..56d7c92d603af 100644
--- a/apps/server/graphql.config.ts
+++ b/apps/server/graphql.config.ts
@@ -1,7 +1,7 @@
import { defineConfig } from "@effect/graphql-generator/Config";
// `schema/expo.graphql` is api.expo.dev's schema, read by introspection
-// (`vp run generate:expo-schema`). The EAS Simulator operations are the ones
+// (`vp run generate:expo-schema`). The Expo Simulators operations are the ones
// eas-cli's `simulator:*` commands send; Expo does not document them.
export default defineConfig({
schema: "./schema/expo.graphql",
diff --git a/apps/server/src/device/DeviceHost.ts b/apps/server/src/device/DeviceHost.ts
index eafa3b6319de3..898b028c4329c 100644
--- a/apps/server/src/device/DeviceHost.ts
+++ b/apps/server/src/device/DeviceHost.ts
@@ -139,7 +139,7 @@ export interface DeviceOperations {
deviceId: string,
) => Effect.Effect;
/**
- * Set by hosts that end devices on their own (EAS stops sessions at their
+ * Set by hosts that end devices on their own (Expo stops sessions at their
* limits), so a session on a device the host stops listing is dropped.
*/
readonly endsDevices?: boolean;
diff --git a/apps/server/src/device/DeviceHubProxy.ts b/apps/server/src/device/DeviceHubProxy.ts
index 56132433c8869..0d606df1d513a 100644
--- a/apps/server/src/device/DeviceHubProxy.ts
+++ b/apps/server/src/device/DeviceHubProxy.ts
@@ -155,7 +155,7 @@ const proxyHttp = Effect.fn("DeviceHubProxy.proxyHttp")(function* (
const response = yield* httpClient.execute(upstreamRequest);
const headers: Record = {};
for (const [name, value] of Object.entries(response.headers)) {
- // A cookie from an upstream such as an EAS session's preview host would land on T3's origin.
+ // A cookie from an upstream such as an Expo Simulators session's preview host would land on T3's origin.
if (
name === "content-encoding" ||
name === "transfer-encoding" ||
diff --git a/apps/server/src/device/DeviceService.test.ts b/apps/server/src/device/DeviceService.test.ts
index 71c7b6994ca86..ff93492f4c1f1 100644
--- a/apps/server/src/device/DeviceService.test.ts
+++ b/apps/server/src/device/DeviceService.test.ts
@@ -347,7 +347,7 @@ const fixture = Effect.fn("fixture")(function* (
}),
),
);
- // The host ending a device on its own, as EAS does at a session's limits.
+ // The host ending a device on its own, as Expo does at a session's limits.
const endDevice = () => {
booted = false;
};
diff --git a/apps/server/src/device/DeviceService.ts b/apps/server/src/device/DeviceService.ts
index 78b31b87aefd3..12efc1b1f297c 100644
--- a/apps/server/src/device/DeviceService.ts
+++ b/apps/server/src/device/DeviceService.ts
@@ -163,7 +163,7 @@ export class DeviceService extends Context.Service<
readonly testHost: (
config: SshDeviceHostConfig,
) => Effect.Effect;
- /** Who an Expo credential signs in as and which EAS projects it can run sessions under. */
+ /** Who an Expo credential signs in as and which Expo projects it can run sessions under. */
readonly easAccount: (
input: DeviceEasAccountInput,
) => Effect.Effect;
@@ -598,7 +598,7 @@ export const makeWithHosts = Effect.fn("DeviceService.makeWithHosts")(function*
),
...devices.filter((device) => !incompletePlatforms.includes(device.platform)),
],
- // A host that ends devices itself (EAS stops sessions at their limits)
+ // A host that ends devices itself (Expo stops sessions at their limits)
// leaves sessions on devices it no longer lists with nothing to stream.
// Other hosts can miss a device for one listing, so theirs stay.
sessions: ready.devices.endsDevices
@@ -1127,7 +1127,7 @@ export const makeWithHosts = Effect.fn("DeviceService.makeWithHosts")(function*
easAccount: Effect.fn("DeviceService.easAccount")(function () {
return Effect.fail(
new DeviceEasAccountError({
- reason: "EAS accounts are unavailable in this device service.",
+ reason: "Expo accounts are unavailable in this device service.",
}),
);
}),
diff --git a/apps/server/src/device/EasDeviceHost.test.ts b/apps/server/src/device/EasDeviceHost.test.ts
index 3c083cdcbb7f8..eaceea13f4fbf 100644
--- a/apps/server/src/device/EasDeviceHost.test.ts
+++ b/apps/server/src/device/EasDeviceHost.test.ts
@@ -26,7 +26,7 @@ const APP_ID = "d763fcb8-d37c-41ea-a773-b54a0ab4a454";
const config = (overrides: Partial = {}): EasDeviceHostConfig => ({
kind: "eas",
id: "eas",
- label: "EAS Simulator",
+ label: "Expo Simulators",
appId: APP_ID,
accessToken: "expo-token",
maxSessionMinutes: 25,
@@ -174,7 +174,7 @@ const fakeExpo = (
node: {
id: "someone-else",
status: "IN_PROGRESS",
- name: "T3 Code · EAS Simulator · 000000",
+ name: "T3 Code · Expo Simulators · 000000",
},
},
...(options.active ?? []).map((node) => ({ node })),
@@ -260,7 +260,7 @@ const makeHost = (
Effect.provideService(Scope.Scope, scope),
);
-describe("EAS Simulator host", () => {
+describe("Expo Simulators host", () => {
it.effect("starts a bounded session and routes its stream and agent to that session", () =>
Effect.gen(function* () {
const expo = fakeExpo();
@@ -433,13 +433,13 @@ describe("EAS Simulator host", () => {
yield* ready.devices.boot(catalogDevice!);
const refused = yield* ready.devices.boot(catalogDevice!).pipe(Effect.flip);
expect(refused.message).toBe(
- "EAS Simulator is unavailable: EAS Simulator is limited to 1 running session. Close one in the Device panel first.",
+ "Expo Simulators is unavailable: Expo Simulators is limited to 1 running session. Close one in the Device panel first.",
);
expect(expo.named("T3CreateEasSimulatorSession")).toHaveLength(1);
}).pipe(Effect.scoped, Effect.provide(layer)),
);
- it.effect("tells concurrent sessions apart although EAS gives each the same UDID", () =>
+ it.effect("tells concurrent sessions apart although Expo gives each the same UDID", () =>
Effect.gen(function* () {
const expo = fakeExpo();
const scope = yield* Scope.make();
@@ -610,7 +610,7 @@ describe("EAS Simulator host", () => {
}).pipe(Effect.scoped, Effect.provide(layer)),
);
- it.effect("asks for an EAS project before starting anything when none can be found", () =>
+ it.effect("asks for an Expo project before starting anything when none can be found", () =>
Effect.gen(function* () {
const expo = fakeExpo();
const host = yield* makeHost(expo, config({ appId: undefined }), yield* Scope.make());
diff --git a/apps/server/src/device/EasDeviceHost.ts b/apps/server/src/device/EasDeviceHost.ts
index 719cfbf435a8a..0751a41b6d309 100644
--- a/apps/server/src/device/EasDeviceHost.ts
+++ b/apps/server/src/device/EasDeviceHost.ts
@@ -1,5 +1,5 @@
/**
- * Cloud simulators from EAS Simulator. A device exists only while a session
+ * Cloud simulators from Expo Simulators. A device exists only while a session
* runs, and every session bills the Expo account until it stops, so this host
* bounds each one, stops all of them when it stops, and stops sessions a
* previous server left behind. It never touches sessions it did not start.
@@ -59,14 +59,14 @@ const decodeServeEmuApi = Schema.decodeUnknownEffect(
*/
const PLATFORMS = {
ios: {
- name: "iPhone (EAS Simulator)",
+ name: "iPhone (Expo Simulator)",
hubPrefix: "/vendor/serve-sim",
previewPrefix: "",
protocol: "serve-sim",
remoteDeviceId: (api: unknown) => decodeServeSimApi(api).pipe(Effect.map((api) => api.device)),
},
android: {
- name: "Android (EAS Simulator)",
+ name: "Android (Expo Simulator)",
hubPrefix: "/vendor/serve-emu",
previewPrefix: "/vendor/serve-emu",
protocol: "serve-emu",
@@ -74,7 +74,7 @@ const PLATFORMS = {
},
} as const;
-/** EAS picks the simulator model; one entry starts a session. */
+/** Expo picks the simulator model; one entry starts a session. */
const CATALOG: ReadonlyArray = [
{
id: "eas-ios",
@@ -163,7 +163,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
>();
const hostId = config.id;
const ledgerPath = path.join(server.stateDir, "device", "eas", `${hostId}.json`);
- // Keyed by Expo's session id, which is also the device id: every EAS
+ // Keyed by Expo's session id, which is also the device id: every Expo
// simulator reports the same remote device id, so that id cannot tell sessions apart.
const sessions = new Map();
const checkedAt = new Map();
@@ -239,7 +239,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
Effect.flatMap(decodeLedger),
Effect.mapError((cause) =>
unavailable(
- `The record of running EAS sessions at ${ledgerPath} could not be read. Fix or remove it.`,
+ `The record of running Expo Simulators sessions at ${ledgerPath} could not be read. Fix or remove it.`,
cause,
),
),
@@ -256,7 +256,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
Effect.provide(services),
Effect.mapError((cause) =>
unavailable(
- `The record of running EAS sessions at ${ledgerPath} could not be written.`,
+ `The record of running Expo Simulators sessions at ${ledgerPath} could not be written.`,
cause,
),
),
@@ -267,13 +267,13 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
entries.map((entry) => (entry.name === name ? { ...entry, refused: true } : entry)),
).pipe(
Effect.catch((cause) =>
- Effect.logWarning("Could not update the EAS session record", { name, cause }),
+ Effect.logWarning("Could not update the Expo Simulators session record", { name, cause }),
),
);
const forgetEntry = (name: string) =>
writeLedger((entries) => entries.filter((entry) => entry.name !== name)).pipe(
Effect.catch((cause) =>
- Effect.logWarning("Could not update the EAS session record", { name, cause }),
+ Effect.logWarning("Could not update the Expo Simulators session record", { name, cause }),
),
);
@@ -282,7 +282,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
expo.stop(sessionId).pipe(
Effect.andThen(forgetEntry(name)),
Effect.tapError((cause) =>
- Effect.logWarning("Could not stop EAS Simulator session", { sessionId, cause }),
+ Effect.logWarning("Could not stop Expo Simulators session", { sessionId, cause }),
),
);
@@ -403,7 +403,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
},
reapLock.withPermit,
Effect.catch((cause) =>
- Effect.logWarning("Could not stop recorded EAS Simulator sessions", { cause }),
+ Effect.logWarning("Could not stop recorded Expo Simulators sessions", { cause }),
),
);
@@ -439,7 +439,9 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
hostId,
deviceId: sessionId,
reason: "launch_failed",
- cause: new Error(`EAS Simulator session ended (${session.status}) before it was ready`),
+ cause: new Error(
+ `Expo Simulators session ended (${session.status}) before it was ready`,
+ ),
});
}
if (session.status === "IN_PROGRESS" && session.endpoints) return session.endpoints;
@@ -456,7 +458,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
hostId,
deviceId: sessionId,
reason: "timeout",
- cause: new Error("EAS Simulator session did not start in time"),
+ cause: new Error("Expo Simulators session did not start in time"),
}),
),
}),
@@ -504,7 +506,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
);
if (!appId) {
return yield* unavailable(
- "No EAS project to run the session under. Choose one for this host in Settings, or open the device from a thread whose project names extra.eas.projectId in app.json or its app config.",
+ "No Expo project to run the session under. Choose one for this host in Settings, or open the device from a thread whose project names extra.eas.projectId in app.json or its app config.",
);
}
const access = yield* expo
@@ -512,7 +514,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
.pipe(Effect.mapError((error) => unavailable(error.message, error)));
if (!access.available) {
return yield* unavailable(
- `EAS Simulator is not enabled for the ${access.account} Expo account.`,
+ `Expo Simulators is not enabled for the ${access.account} Expo account.`,
);
}
const entry = { name, appId, recordedAt: yield* Clock.currentTimeMillis };
@@ -593,7 +595,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
hostId,
deviceId: sessionId,
reason: "launch_failed",
- cause: new Error("EAS Simulator returned no preview endpoint"),
+ cause: new Error("Expo Simulators returned no preview endpoint"),
});
}
const origin = new URL(endpoints.preview.url).origin;
@@ -767,7 +769,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
new DeviceOperationError({
operation: "screenshot",
reason: "request_failed",
- cause: new Error("The EAS Simulator session is not running"),
+ cause: new Error("The Expo Simulator is not running"),
}),
),
onSome: (session) =>
@@ -795,7 +797,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
}),
agentEndpoint: (deviceId) =>
Option.match(sessionFor(deviceId), {
- onNone: () => Effect.fail(unavailable("This EAS Simulator device is no longer running.")),
+ onNone: () => Effect.fail(unavailable("This Expo Simulator is no longer running.")),
onSome: (session) =>
Effect.succeed({ ...session.agent, agentDeviceId: session.remoteDeviceId }),
}),
@@ -858,11 +860,11 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
onNone: () => Effect.void,
onSome: (running) => releaseAgentDeviceSession(http, running.agent)(session),
}),
- // Device settings run simctl on the simulator's own machine, which EAS does not expose.
+ // Device settings run simctl on the simulator's own machine, which Expo does not expose.
run: () =>
Effect.succeed({
stdout: "",
- stderr: "EAS Simulator devices cannot run host commands.",
+ stderr: "Devices from Expo Simulators cannot run host commands.",
code: 127,
}),
helpers: { serveSimAxSettings: null, serveSimCli: null },
diff --git a/apps/server/src/device/ExpoApi.test.ts b/apps/server/src/device/ExpoApi.test.ts
index 730d34d38d9f8..491a75f97a0e7 100644
--- a/apps/server/src/device/ExpoApi.test.ts
+++ b/apps/server/src/device/ExpoApi.test.ts
@@ -154,7 +154,7 @@ describe("Expo API", () => {
.availability("app-1")
.pipe(Effect.flip);
expect(graphQl.message).toBe(
- "Expo could not check EAS Simulator access: Feature not enabled",
+ "Expo could not check Expo Simulators access: Feature not enabled",
);
const rejected = yield* makeExpoApi(respond(new Response("no", { status: 401 })), credential)
.stop("session-1")
diff --git a/apps/server/src/device/ExpoApi.ts b/apps/server/src/device/ExpoApi.ts
index 90a276eeffb99..99371b564e6c1 100644
--- a/apps/server/src/device/ExpoApi.ts
+++ b/apps/server/src/device/ExpoApi.ts
@@ -1,5 +1,5 @@
/**
- * Expo's GraphQL API for EAS Simulator sessions. The operations in
+ * Expo's GraphQL API for Expo Simulators sessions. The operations in
* `ExpoApi.graphql` are the ones eas-cli's `simulator:*` commands send; their
* client is generated from `schema/expo.graphql` (`vp run generate`).
*/
@@ -313,7 +313,7 @@ export const makeExpoApi = (http: HttpClient.HttpClient, credential: ExpoCredent
),
),
availability: (appId: string) =>
- call("check EAS Simulator access", (expo) =>
+ call("check Expo Simulators access", (expo) =>
expo.T3EasSimulatorAvailability({ appId, filter: [DEVICE_RUN_SESSIONS_GATE] }),
).pipe(
Effect.map(({ app }) => {
diff --git a/apps/server/src/device/easProjectId.test.ts b/apps/server/src/device/easProjectId.test.ts
index 42139f4eff1e1..ea23f444e7f49 100644
--- a/apps/server/src/device/easProjectId.test.ts
+++ b/apps/server/src/device/easProjectId.test.ts
@@ -246,7 +246,7 @@ it.effect("gives no answer when an app's config is there but cannot be read", ()
}).pipe(Effect.scoped, Effect.provide(layer)),
);
-it.effect("does not guess between apps that name different EAS projects", () =>
+it.effect("does not guess between apps that name different Expo projects", () =>
Effect.gen(function* () {
const root = yield* workspace({
"apps/one/app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_A } } } }),
diff --git a/apps/server/src/device/easProjectId.ts b/apps/server/src/device/easProjectId.ts
index 524dd6d9519c0..528db26870ca5 100644
--- a/apps/server/src/device/easProjectId.ts
+++ b/apps/server/src/device/easProjectId.ts
@@ -33,7 +33,7 @@ const SPREAD_LATER = /\.\.\./;
// Space, a comment, or an opening parenthesis: what may sit between `...`
// and the thing spread. Sticky, so the scan moves through the file once.
const SPREAD_FILLER = /(?:\s+|\/\/[^\n\r\u2028\u2029]*|\/\*(?:[^*]|\*(?!\/))*\*\/|\()/y;
-// `config`'s `extra` and `extra.eas` entries, the holders of the EAS id
+// `config`'s `extra` and `extra.eas` entries, the holders of the Expo project id
// (dotted, optional-chained or in brackets).
const EXTRA_OF_CONFIG = String.raw`config(?:\s*\??\.\s*extra|\s*(?:\?\.)?\s*\[\s*["'\x60]extra["'\x60]\s*\])`;
const EAS_OF_CONFIG =
@@ -197,7 +197,7 @@ const projectIdsOf = Effect.fn("easProjectId.projectIdsOf")(function* (dir: stri
});
/**
- * The EAS project of a workspace's Expo app: its root, or one app below
+ * The Expo project of a workspace's Expo app: its root, or one app below
* `apps/` or `packages/`. None when there is none, a config is ambiguous, or
* the apps disagree, so the caller asks for an explicit choice instead of
* billing the wrong project.
diff --git a/apps/server/src/device/localSshDeviceHost.test.ts b/apps/server/src/device/localSshDeviceHost.test.ts
index 4021be704a06e..623f2583acd27 100644
--- a/apps/server/src/device/localSshDeviceHost.test.ts
+++ b/apps/server/src/device/localSshDeviceHost.test.ts
@@ -83,7 +83,7 @@ it.effect("removes only self targets from a fanned-out host list", () =>
const eas = {
kind: "eas" as const,
id: "eas",
- label: "EAS Simulator",
+ label: "Expo Simulators",
accessToken: "",
maxSessionMinutes: 30,
idleMinutes: 10,
diff --git a/apps/server/src/mcp/McpDeviceToolkit.test.ts b/apps/server/src/mcp/McpDeviceToolkit.test.ts
index 1904a24010bee..91c33029be305 100644
--- a/apps/server/src/mcp/McpDeviceToolkit.test.ts
+++ b/apps/server/src/mcp/McpDeviceToolkit.test.ts
@@ -135,7 +135,7 @@ const layerDeviceServiceMock = Layer.mock(DeviceService.DeviceService)({
screenshot: () => Effect.succeed({ device, png }),
close: () => Effect.void,
testHost: () => Effect.die("not used"),
- // As for an EAS device, agent-device knows the device by a different id than T3.
+ // As for an Expo device, agent-device knows the device by a different id than T3.
agentTarget: () =>
Effect.succeed({
agentDeviceId: "SIM-UDID",
diff --git a/apps/server/src/mcp/toolkits/device/handlers.ts b/apps/server/src/mcp/toolkits/device/handlers.ts
index d4f0a4fac6a67..382beed7284ac 100644
--- a/apps/server/src/mcp/toolkits/device/handlers.ts
+++ b/apps/server/src/mcp/toolkits/device/handlers.ts
@@ -49,7 +49,7 @@ export function agentDeviceQuickStart(
.filter(Boolean)
.join(" ")
: host?.kind === "eas"
- ? "This is an EAS Simulator session in the cloud. It bills the Expo account per minute until it stops, so call device_close with shutdown: true when you are done. It starts with no apps installed: install-from-source installs a build from a URL (iOS needs a .tar.gz containing a .app), and install uploads one from this machine."
+ ? "This is an Expo Simulators session in the cloud. It bills the Expo account per minute until it stops, so call device_close with shutdown: true when you are done. It starts with no apps installed: install-from-source installs a build from a URL (iOS needs a .tar.gz containing a .app), and install uploads one from this machine."
: device.platform === "ios"
? "First use builds an XCTest runner and can take a couple of minutes; later commands are fast."
: "The Android snapshot helper installs itself on first use.";
@@ -275,7 +275,7 @@ const handlers = {
after.devices.find(
(candidate) => candidate.hostId === session.hostId && candidate.id === session.deviceId,
) ?? target;
- // Target the opened device: an EAS device and its agent-device daemon
+ // Target the opened device: an Expo device and its agent-device daemon
// exist only once its session runs, and Android ids change on boot.
const opened = {
threadId: scope.thread.threadId,
diff --git a/apps/server/src/mcp/toolkits/device/tools.ts b/apps/server/src/mcp/toolkits/device/tools.ts
index 0a79af2efb0f6..14ed87217368e 100644
--- a/apps/server/src/mcp/toolkits/device/tools.ts
+++ b/apps/server/src/mcp/toolkits/device/tools.ts
@@ -58,7 +58,7 @@ const DeviceOpenTool = Tool.make("device_open", {
FileSystem.FileSystem,
Path.Path,
ServerConfig.ServerConfig,
- // The thread's project can name the EAS project a cloud device runs under.
+ // The thread's project can name the Expo project a cloud device runs under.
ProjectService.ProjectService,
],
})
diff --git a/apps/server/src/serverSettings.test.ts b/apps/server/src/serverSettings.test.ts
index 3ca2d29da7c81..873649cb168f5 100644
--- a/apps/server/src/serverSettings.test.ts
+++ b/apps/server/src/serverSettings.test.ts
@@ -1469,7 +1469,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("server settings"
{
kind: "eas",
id: "eas",
- label: "EAS Simulator",
+ label: "Expo Simulators",
accessToken: "expo-secret",
maxSessionMinutes: 30,
idleMinutes: 10,
@@ -1786,7 +1786,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("server settings"
{
kind: "eas",
id: "eas",
- label: "EAS Simulator",
+ label: "Expo Simulators",
accessToken: easReference,
maxSessionMinutes: 30,
idleMinutes: 10,
@@ -1906,7 +1906,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("server settings"
{
kind: "eas",
id: "eas",
- label: "EAS Simulator",
+ label: "Expo Simulators",
accessToken: personal("Expo/token"),
maxSessionMinutes: 30,
idleMinutes: 10,
diff --git a/apps/server/src/settingsSecrets.ts b/apps/server/src/settingsSecrets.ts
index 22ea8ae882583..a38072d19813f 100644
--- a/apps/server/src/settingsSecrets.ts
+++ b/apps/server/src/settingsSecrets.ts
@@ -235,7 +235,7 @@ function mapSecretFieldGroups(
) as EasDeviceHostConfig,
);
- // Its own prefix: an EAS and a Simlock host may share an id.
+ // Its own prefix: an Expo and a Simlock host may share an id.
const simlockDeviceHosts = settings.simlockDeviceHosts.map(
(host) =>
mapFields(
diff --git a/apps/web/src/components/device/DeviceSetup.tsx b/apps/web/src/components/device/DeviceSetup.tsx
index 283525ea6e164..f167d35192b92 100644
--- a/apps/web/src/components/device/DeviceSetup.tsx
+++ b/apps/web/src/components/device/DeviceSetup.tsx
@@ -138,7 +138,7 @@ export function platformSetupStatus(state: DeviceServiceState, platform: DeviceP
ready: true,
message:
remoteHost?.kind === "eas"
- ? `${remoteHost.label} starts ${platform === "ios" ? "iOS Simulators" : "Android emulators"} in the cloud with EAS Simulator.`
+ ? `${remoteHost.label} starts ${platform === "ios" ? "iOS Simulators" : "Android emulators"} in the cloud with Expo Simulators.`
: platform === "ios"
? `Xcode and iOS Simulator are available${location}.`
: `The Android SDK and Emulator are available${location}.`,
diff --git a/apps/web/src/components/device/DeviceWorkspace.tsx b/apps/web/src/components/device/DeviceWorkspace.tsx
index 21f51520ba3a3..d9206535017b9 100644
--- a/apps/web/src/components/device/DeviceWorkspace.tsx
+++ b/apps/web/src/components/device/DeviceWorkspace.tsx
@@ -33,7 +33,7 @@ export function DeviceWorkspace(props: {
// A capture always finishes, even if the panel hides or closes meanwhile; the user asked for it.
const capturing = useRef(false);
const access = useDeviceHubAccess(props.environmentId, props.device.hostId);
- // Settings and tools run commands on the device's own machine, which EAS and Simlock do not expose.
+ // Settings and tools run commands on the device's own machine, which Expo and Simlock do not expose.
const runsHostCommands = props.hostKind === "local" || props.hostKind === "ssh";
const controls = useDeviceControls({
...props,
diff --git a/apps/web/src/components/settings/DeviceSourcesSettings.tsx b/apps/web/src/components/settings/DeviceSourcesSettings.tsx
index 9d4e07b0fb0f4..2b8ce2ae0ff63 100644
--- a/apps/web/src/components/settings/DeviceSourcesSettings.tsx
+++ b/apps/web/src/components/settings/DeviceSourcesSettings.tsx
@@ -84,7 +84,7 @@ interface SourceRow {
readonly description: ReactNode;
readonly environments: ReadonlyArray;
/**
- * One machine or account every environment reaches the same way (an SSH host, EAS, a Simlock
+ * One machine or account every environment reaches the same way (an SSH host, Expo, a Simlock
* pool), so its platforms are the same for all of them. Local simulators differ per machine.
*/
readonly shared: boolean;
@@ -262,7 +262,7 @@ export function DeviceSourcesSettings(props: {
),
},
})),
- remove ? "EAS host not removed everywhere" : "EAS host not saved everywhere",
+ remove ? "Expo host not removed everywhere" : "Expo host not saved everywhere",
);
if (saved) setEditing(null);
};
@@ -460,7 +460,7 @@ export function DeviceSourcesSettings(props: {
key: `eas:${host.id}`,
shared: true,
title: host.label,
- kind: "EAS",
+ kind: "Expo",
description: easSessionLimits(host),
environments: active.map((member) => {
const added = (member.settings?.easDeviceHosts ?? []).some(
@@ -551,7 +551,7 @@ export function DeviceSourcesSettings(props: {
})
}
>
- EAS Simulator
+ Expo Simulators
) : null}
{props.supportsSimlock && simlockEnabled ? (
diff --git a/apps/web/src/components/settings/EasDeviceHostEditor.tsx b/apps/web/src/components/settings/EasDeviceHostEditor.tsx
index e11d9dfa748aa..3207887133e60 100644
--- a/apps/web/src/components/settings/EasDeviceHostEditor.tsx
+++ b/apps/web/src/components/settings/EasDeviceHostEditor.tsx
@@ -174,7 +174,7 @@ export function EasDeviceHostEditor(props: {
}}
>
- {props.isNew ? "Add EAS host" : "Edit EAS host"}
+ {props.isNew ? "Add Expo host" : "Edit Expo host"}
The environment's server signs in to Expo and starts the sessions. Without a token
here it uses EXPO_TOKEN, then its eas login.
@@ -277,7 +277,7 @@ export function EasDeviceHostEditor(props: {
- EAS project
+ Expo project
- Expo allows sessions of up to 40 minutes on free accounts and 115 on paid ones, and
- ends one after the idle minutes without activity, so idle minutes must be smaller than
+ Expo Simulators needs a paid Expo account. A session runs for up to 115 minutes and
+ stops early when it is idle for the idle minutes, so idle minutes must be less than
session minutes.
- {props.isNew ? null : " Saving restarts this host, which stops its running sessions."}
+ {props.isNew ? null : " Saving restarts this host and stops its running sessions."}
{problem === null ? null : (
diff --git a/apps/web/src/components/settings/SecretsSettings.logic.test.ts b/apps/web/src/components/settings/SecretsSettings.logic.test.ts
index f4e820481cfad..01dffa4909543 100644
--- a/apps/web/src/components/settings/SecretsSettings.logic.test.ts
+++ b/apps/web/src/components/settings/SecretsSettings.logic.test.ts
@@ -29,7 +29,7 @@ const settings = Schema.decodeSync(ServerSettings)({
hub: { kind: "cliproxy", url: "https://hub.test", managementKey: personal("op://hub") },
},
easDeviceHosts: [
- { kind: "eas", id: "eas", label: "EAS Simulator", accessToken: personal("op://expo") },
+ { kind: "eas", id: "eas", label: "Expo Simulators", accessToken: personal("op://expo") },
],
simlockDeviceHosts: [
{
@@ -51,7 +51,7 @@ it.each([
"Codex · CODEX_TOKEN",
"GitHub · github.com",
"https://hub.test · Management Key",
- "EAS Simulator · Access Token",
+ "Expo Simulators · Access Token",
"Simlock Pool · Agent Token",
"Voice · OpenAI",
],
diff --git a/apps/web/src/components/settings/easDeviceHostsSettings.logic.test.ts b/apps/web/src/components/settings/easDeviceHostsSettings.logic.test.ts
index c3105b115e21f..d4a68d10dabbb 100644
--- a/apps/web/src/components/settings/easDeviceHostsSettings.logic.test.ts
+++ b/apps/web/src/components/settings/easDeviceHostsSettings.logic.test.ts
@@ -7,8 +7,8 @@ import {
updateEasDeviceHosts,
} from "./easDeviceHostsSettings.logic";
-describe("EAS device host settings", () => {
- it("rejects limits EAS does not allow", () => {
+describe("Expo device host settings", () => {
+ it("rejects limits Expo does not allow", () => {
expect(Option.isSome(parseEasDeviceHostDraft(newEasDeviceHost("eas")))).toBe(true);
expect(
Option.isNone(parseEasDeviceHostDraft({ ...newEasDeviceHost("eas"), maxSessionMinutes: 10 })),
diff --git a/apps/web/src/components/settings/easDeviceHostsSettings.logic.ts b/apps/web/src/components/settings/easDeviceHostsSettings.logic.ts
index d91fe45bb9205..1657560fd8adc 100644
--- a/apps/web/src/components/settings/easDeviceHostsSettings.logic.ts
+++ b/apps/web/src/components/settings/easDeviceHostsSettings.logic.ts
@@ -9,14 +9,14 @@ export const parseEasDeviceHostDraft = Schema.decodeUnknownOption(EasDeviceHostC
export const newEasDeviceHost = (id: string): EasDeviceHostConfigType => ({
kind: "eas",
id,
- label: "EAS Simulator",
+ label: "Expo Simulators",
accessToken: "",
maxSessionMinutes: 30,
idleMinutes: 10,
maxConcurrentSessions: 2,
});
-/** Adds, replaces, or removes one EAS host. */
+/** Adds, replaces, or removes one Expo host. */
/**
* With `keepToken`, the environment keeps the token it holds: a saved token arrives redacted, and
* one environment's token says nothing about another's. One new to the host uses its own Expo login.
diff --git a/apps/web/src/state/device.ts b/apps/web/src/state/device.ts
index ee43428f740f5..b4e4923ddc719 100644
--- a/apps/web/src/state/device.ts
+++ b/apps/web/src/state/device.ts
@@ -169,7 +169,7 @@ export const NO_DEVICE_PROBE_ATOM = Atom.make(AsyncResult.initial()
);
/**
- * The Expo account an EAS host editor shows as it opens, for the saved
+ * The Expo account an Expo host editor shows as it opens, for the saved
* credential. Each open checks again; edits and manual checks use the command.
*/
export const deviceEasAccountCheck = createEnvironmentRpcQueryAtomFamily(connectionAtomRuntime, {
diff --git a/docs/internals/devices.md b/docs/internals/devices.md
index 3fddb7c4d7a02..051f57411d07b 100644
--- a/docs/internals/devices.md
+++ b/docs/internals/devices.md
@@ -26,10 +26,10 @@ operations, so a host whose devices live elsewhere only replaces them.
SSH hosts forward both endpoints to server loopback. Every proxied request
also carries the host id; device ids alone are not unique across hosts.
-## EAS Simulator hosts are billed sessions
+## Expo hosts run billed sessions
-An [EAS host](../../apps/server/src/device/EasDeviceHost.ts) has no machine:
-each opened device is an EAS Simulator session that bills the Expo account
+An [Expo host](../../apps/server/src/device/EasDeviceHost.ts) has no machine:
+each opened device is an Expo Simulators session that bills the Expo account
until it stops. Every session is created with the host's run and idle limits,
the host refuses to start past its session limit, and closing the host stops
its sessions. Sessions it starts are recorded under the state directory and
@@ -42,7 +42,7 @@ route each request (`DeviceHostReady.upstream`) and adds the session token serve
clients never hold it. Agent config files are written per device
(`DeviceOperations.agentEndpoint`), which is why `device_open` opens the
device before targeting it. Device settings and tools run `simctl` or `adb` on
-the device's machine, which EAS does not expose, so they are unavailable there.
+the device's machine, which Expo does not expose, so they are unavailable there.
## Simlock hosts lease through the agent-device front
@@ -145,12 +145,12 @@ WebCodecs is secure-context only, so the viewer probes `isConfigSupported` and f
MJPEG on iOS when decoding is unavailable. Android's SEMU socket has no MJPEG;
there the panel reports that it cannot decode.
-serve-sim can also be locked to WebRTC, as on EAS Simulator, and then refuses
+serve-sim can also be locked to WebRTC, as on Expo Simulators, and then refuses
AVCC with a 409 naming the transport. The viewer still asks for AVCC first, so
hubs that serve it pay nothing, and switches on that 409, or when its MJPEG
image fails in a browser that has `RTCPeerConnection`. Offers are not trickled:
serve-sim takes one offer with every candidate. The video element only feeds
the same canvas sink, so the panel and the mobile WebView keep one surface.
Android asks serve-emu's `/api` before opening its video socket and streams
-WebRTC when it is advertised (EAS Simulator), keeping a separate `video=0`
+WebRTC when it is advertised (Expo Simulators), keeping a separate `video=0`
socket for input so input can reconnect without restarting video.
diff --git a/docs/user/devices.md b/docs/user/devices.md
index 327c3e7b5a838..3130e4aa45c6c 100644
--- a/docs/user/devices.md
+++ b/docs/user/devices.md
@@ -94,7 +94,7 @@ started from then on; your own Device panel is unaffected.
The device stream goes through the environment server, so it works over the
local network, Tailscale, and T3 Connect. Live video needs a secure page
(HTTPS or localhost); on a plain-HTTP remote origin iOS falls back to a slower
-still-image stream and Android cannot show video, except on EAS Simulator.
+still-image stream and Android cannot show video, except on Expo Simulators.
## SSH device hosts
diff --git a/packages/client-runtime/src/device/stream.ts b/packages/client-runtime/src/device/stream.ts
index 8af40437cdd23..4e9b9767715a6 100644
--- a/packages/client-runtime/src/device/stream.ts
+++ b/packages/client-runtime/src/device/stream.ts
@@ -66,7 +66,7 @@ const webRtcSettingsSchema = Schema.Struct({
iceServers: Schema.optionalKey(Schema.Array(iceServerSchema)),
iceTransportPolicy: Schema.optionalKey(Schema.Literals(["all", "relay"])),
});
-// serve-sim reports its stream settings as `streamSettings` (EAS) or `stream`.
+// serve-sim reports its stream settings as `streamSettings` (Expo) or `stream`.
const serveSimApiSchema = Schema.Struct({
streamSettings: Schema.optionalKey(Schema.Unknown),
stream: Schema.optionalKey(Schema.Unknown),
@@ -864,7 +864,7 @@ export function createDeviceStreamClient(
};
/**
- * serve-sim can be locked to WebRTC (EAS Simulator always is), and then
+ * serve-sim can be locked to WebRTC (an Expo Simulator always is), and then
* refuses AVCC and MJPEG; serve-emu advertises WebRTC the same way. An
* unreadable answer keeps the default path.
*/
diff --git a/packages/client-runtime/src/state/device.ts b/packages/client-runtime/src/state/device.ts
index 2be3d213abcb2..e189fdaa4cb59 100644
--- a/packages/client-runtime/src/state/device.ts
+++ b/packages/client-runtime/src/state/device.ts
@@ -16,9 +16,9 @@ export function createDeviceEnvironmentAtoms(
mode: "serial" as const,
key: ({ environmentId }: { environmentId: string }) => environmentId,
};
- // An EAS Simulator start can take minutes; it must not hold up powering off
+ // Starting an Expo Simulator can take minutes; it must not hold up powering off
// another device or turning device support off, so each device opens in its
- // own lane. Every EAS start opens the same catalog device, so the thread is
+ // own lane. Every Expo start opens the same catalog device, so the thread is
// part of the lane too.
const openConcurrency = {
mode: "serial" as const,
diff --git a/packages/contracts/src/device.test.ts b/packages/contracts/src/device.test.ts
index e49e54a09fdf5..e85e1162931b9 100644
--- a/packages/contracts/src/device.test.ts
+++ b/packages/contracts/src/device.test.ts
@@ -14,7 +14,7 @@ const decodeSshHosts = Schema.decodeUnknownSync(SshDeviceHostConfigs);
const decodeEas = Schema.decodeUnknownSync(EasDeviceHostConfigs);
const encodeState = Schema.encodeSync(DeviceServiceState);
const decodeState = Schema.decodeUnknownSync(DeviceServiceState);
-// The host summary as clients decoded it before EAS hosts existed.
+// The host summary as clients decoded it before Expo hosts existed.
const decodeOlderState = Schema.decodeUnknownSync(
Schema.Struct({
hosts: Schema.Array(
@@ -24,15 +24,15 @@ const decodeOlderState = Schema.decodeUnknownSync(
);
describe("configured device hosts", () => {
- it("reads SSH hosts saved before hosts had a kind, and bounds EAS sessions", () => {
+ it("reads SSH hosts saved before hosts had a kind, and bounds Expo Simulators sessions", () => {
expect(decodeSshHosts([{ id: "mac", label: "Mac mini", target: "julius@mac" }])).toEqual([
{ kind: "ssh", id: "mac", label: "Mac mini", target: "julius@mac" },
]);
- expect(decodeEas([{ kind: "eas", id: "eas", label: "EAS Simulator" }])).toEqual([
+ expect(decodeEas([{ kind: "eas", id: "eas", label: "Expo Simulators" }])).toEqual([
{
kind: "eas",
id: "eas",
- label: "EAS Simulator",
+ label: "Expo Simulators",
accessToken: "",
maxSessionMinutes: 30,
idleMinutes: 10,
@@ -40,21 +40,21 @@ describe("configured device hosts", () => {
},
]);
expect(() =>
- decodeEas([{ kind: "eas", id: "eas", label: "EAS", maxSessionMinutes: 600 }]),
+ decodeEas([{ kind: "eas", id: "eas", label: "Expo", maxSessionMinutes: 600 }]),
).toThrow();
// The default idle limit of 10 is not smaller than a session limit of 10.
expect(() =>
- decodeEas([{ kind: "eas", id: "eas", label: "EAS", maxSessionMinutes: 10 }]),
+ decodeEas([{ kind: "eas", id: "eas", label: "Expo", maxSessionMinutes: 10 }]),
).toThrow();
});
- it("marks the EAS access token as a secret setting", () => {
+ it("marks the Expo access token as a secret setting", () => {
expect(secretSettingsFields(EasDeviceHostConfig)).toEqual(["accessToken"]);
expect(secretSettingsFields(SimlockDeviceHostConfig)).toEqual(["agentToken"]);
});
});
-describe("device state for clients from before EAS hosts", () => {
+describe("device state for clients from before Expo hosts", () => {
const summary = {
label: "Host",
platforms: [],
@@ -77,7 +77,7 @@ describe("device state for clients from before EAS hosts", () => {
revision: 1,
};
- it("sends EAS and Simlock hosts where an older client does not look, and reads them back", () => {
+ it("sends Expo and Simlock hosts where an older client does not look, and reads them back", () => {
const wire = encodeState(state);
expect(decodeOlderState(wire).hosts.map((host) => host.id)).toEqual(["local"]);
expect(decodeState(wire).hosts).toEqual(state.hosts);
diff --git a/packages/contracts/src/device.ts b/packages/contracts/src/device.ts
index dee7daa445242..ab77114980b9a 100644
--- a/packages/contracts/src/device.ts
+++ b/packages/contracts/src/device.ts
@@ -20,7 +20,7 @@ const ConfiguredDeviceHostId = DeviceHostId.check(
);
export const SshDeviceHostConfig = Schema.Struct({
- // Hosts saved before EAS hosts existed carry no kind.
+ // Hosts saved before Expo hosts existed carry no kind.
kind: Schema.Literal("ssh").pipe(Schema.withDecodingDefaultKey(Effect.succeed("ssh" as const))),
id: ConfiguredDeviceHostId,
label: TrimmedNonEmptyString,
@@ -31,14 +31,14 @@ export const SshDeviceHostConfig = Schema.Struct({
export type SshDeviceHostConfig = typeof SshDeviceHostConfig.Type;
/**
- * Cloud simulators from EAS Simulator. Sessions bill the Expo account until
+ * Cloud simulators from Expo Simulators. Sessions bill the Expo account until
* they stop, so every one is bounded. The Expo credential is not stored here.
*/
export const EasDeviceHostConfig = Schema.Struct({
kind: Schema.Literal("eas"),
id: ConfiguredDeviceHostId,
label: TrimmedNonEmptyString,
- /** EAS project that sessions run under, when the project's app config does not name one. */
+ /** Expo project that sessions run under, when the project's app config does not name one. */
appId: Schema.optional(TrimmedNonEmptyString),
/**
* Expo access token, kept in the secret store, or the secret provider to read
@@ -49,7 +49,7 @@ export const EasDeviceHostConfig = Schema.Struct({
Schema.withDecodingDefaultKey(Effect.succeed("")),
Schema.annotateKey({ settingsSecret: true }),
),
- /** EAS allows at most 40 minutes on free accounts and 115 on paid ones. */
+ /** Expo Simulators needs a paid Expo account, and allows sessions of at most 115 minutes. */
maxSessionMinutes: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 115 })).pipe(
Schema.withDecodingDefaultKey(Effect.succeed(30)),
),
@@ -60,7 +60,7 @@ export const EasDeviceHostConfig = Schema.Struct({
Schema.withDecodingDefaultKey(Effect.succeed(2)),
),
}).check(
- // EAS requires the idle limit to be smaller than the session limit.
+ // Expo requires the idle limit to be smaller than the session limit.
Schema.makeFilter(
(host: { readonly idleMinutes: number; readonly maxSessionMinutes: number }) =>
host.idleMinutes < host.maxSessionMinutes ||
@@ -109,16 +109,16 @@ export const SshDeviceHostConfigs = Schema.Array(SshDeviceHostConfig).check(uniq
/**
* Kept apart from the SSH hosts in settings: servers and clients from before
- * EAS hosts decode `deviceHosts` as SSH hosts and would reject the whole file
- * or snapshot over one EAS entry.
+ * Expo hosts decode `deviceHosts` as SSH hosts and would reject the whole file
+ * or snapshot over one Expo entry.
*/
export const EasDeviceHostConfigs = Schema.Array(EasDeviceHostConfig).check(uniqueHostIds);
-/** Kept apart from the other host lists for the same reason as EAS hosts. */
+/** Kept apart from the other host lists for the same reason as Expo hosts. */
export const SimlockDeviceHostConfigs = Schema.Array(SimlockDeviceHostConfig).check(uniqueHostIds);
export const DeviceEasAccountInput = Schema.Struct({
- /** A saved EAS host whose stored token is checked when no new token is given. */
+ /** A saved Expo host whose stored token is checked when no new token is given. */
hostId: Schema.optional(DeviceHostId),
accessToken: Schema.optional(SettingsSecretValue),
});
@@ -264,7 +264,7 @@ const deviceServiceStateFields = {
supportsHostRetry: Schema.optional(Schema.Boolean),
supportsToolUpdate: Schema.optional(Schema.Boolean),
supportsToolInspection: Schema.optional(Schema.Boolean),
- /** Servers from before EAS hosts ignore `easDeviceHosts`, so clients offer them only when set. */
+ /** Servers from before Expo hosts ignore `easDeviceHosts`, so clients offer them only when set. */
supportsEasHosts: Schema.optional(Schema.Boolean),
/** Servers from before Simlock hosts ignore `simlockDeviceHosts`. */
supportsSimlockHosts: Schema.optional(Schema.Boolean),
@@ -283,7 +283,7 @@ const deviceServiceStateFields = {
};
/**
- * EAS host summaries travel as `easHosts`: clients from before EAS hosts
+ * Expo host summaries travel as `easHosts`: clients from before Expo hosts
* decode `hosts` with a `local | ssh` kind and would reject the whole state.
* Decoded, every host is in `hosts`.
*/
diff --git a/packages/contracts/src/settings.test.ts b/packages/contracts/src/settings.test.ts
index 8ef1340b53e29..1db913e38ba3b 100644
--- a/packages/contracts/src/settings.test.ts
+++ b/packages/contracts/src/settings.test.ts
@@ -418,17 +418,17 @@ describe("ServerSettings environment icon", () => {
const decodeDeviceHostSettings = Schema.decodeSync(ServerSettings);
-// `deviceHosts` as it was decoded before EAS hosts existed: an SSH host needs a target.
+// `deviceHosts` as it was decoded before Expo hosts existed: an SSH host needs a target.
const decodeOlderDeviceHostSettings = Schema.decodeUnknownSync(
Schema.Struct({
deviceHosts: Schema.Array(Schema.Struct({ id: Schema.String, target: Schema.String })),
}),
);
-it("keeps EAS hosts out of the SSH host list servers and clients before EAS hosts decode", () => {
+it("keeps Expo hosts out of the SSH host list servers and clients before Expo hosts decode", () => {
const settings = decodeDeviceHostSettings({
deviceHosts: [{ id: "mini", label: "Mac mini", target: "user@mini" }],
- easDeviceHosts: [{ kind: "eas", id: "eas", label: "EAS Simulator" }],
+ easDeviceHosts: [{ kind: "eas", id: "eas", label: "Expo Simulators" }],
});
const wire = encodeServerSettings(settings);
expect(decodeOlderDeviceHostSettings(wire).deviceHosts).toEqual([
@@ -439,7 +439,7 @@ it("keeps EAS hosts out of the SSH host list servers and clients before EAS host
it("validates remote device hosts and rejects ambiguous host ids", () => {
const host = { id: "mini", label: "Mac mini", target: "user@mini", port: 2222 };
- // Hosts saved before EAS hosts existed have no `kind`; they are SSH hosts.
+ // Hosts saved before Expo hosts existed have no `kind`; they are SSH hosts.
expect(decodeDeviceHostSettings({ deviceHosts: [host] }).deviceHosts).toEqual([
{ kind: "ssh", ...host },
]);
From 35308053127bbd7158277ff6fd3aec5b69c7dbfc Mon Sep 17 00:00:00 2001
From: Krystof Woldrich <31292499+krystofwoldrich@users.noreply.github.com>
Date: Sat, 14 Nov 2026 23:40:08 +0100
Subject: [PATCH 021/140] fix(server): find the EAS project of variant app
configs (#29466)
Co-authored-by: Claude Opus 5.5
Co-authored-by: Julius Marminge
---
apps/server/src/device/easProjectId.test.ts | 97 +++++++++++++++++++++
apps/server/src/device/easProjectId.ts | 31 +++++--
2 files changed, 121 insertions(+), 7 deletions(-)
diff --git a/apps/server/src/device/easProjectId.test.ts b/apps/server/src/device/easProjectId.test.ts
index ea23f444e7f49..30aed92d4d631 100644
--- a/apps/server/src/device/easProjectId.test.ts
+++ b/apps/server/src/device/easProjectId.test.ts
@@ -165,6 +165,103 @@ it.effect.each([
},
expected: Option.some(ID_A),
},
+ {
+ case: "reads app.json's id through a typed variant config that spreads parts of config",
+ files: {
+ "app.config.js": `/** @param {import('expo/config').ConfigContext} context */
+ module.exports = ({ config }) => ({
+ ...config,
+ ios: { ...config.ios, infoPlist: { ...config?.ios.infoPlist, CFBundleDisplayName: "Dev" } },
+ plugins: [...config.plugins, "expo-dev-client"],
+ });`,
+ "app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_A } } } }),
+ },
+ expected: Option.some(ID_A),
+ },
+ {
+ case: "reads app.json's id through a config typed in a multi-line JSDoc or line comment",
+ files: {
+ "app.config.js": `// Types: import('expo/config').ExpoConfig
+ /**
+ * The dev variant of the app.
+ * @param {import('expo/config').ConfigContext} context
+ */
+ module.exports = ({ config }) => ({ ...config, name: "Dev" });`,
+ "app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_A } } } }),
+ },
+ expected: Option.some(ID_A),
+ },
+ {
+ case: "gives no answer when a config spreads a part of config over the top, which may bring its own extra",
+ files: {
+ "app.config.js": `module.exports = ({ config }) => ({ ...config, ...config.preview });`,
+ "app.json": JSON.stringify({
+ expo: {
+ extra: { eas: { projectId: ID_A } },
+ preview: { extra: { eas: { projectId: ID_B } } },
+ },
+ }),
+ },
+ expected: Option.none(),
+ },
+ {
+ case: "gives no answer when a config wraps a part of config under another key, as Expo reads expo",
+ files: {
+ "app.config.js": `module.exports = ({ config }) =>
+ process.env.APP_VARIANT === "preview" ? { expo: { ...config.preview } } : { ...config };`,
+ "app.json": JSON.stringify({
+ expo: {
+ extra: { eas: { projectId: ID_A } },
+ preview: { extra: { eas: { projectId: ID_B } } },
+ },
+ }),
+ },
+ expected: Option.none(),
+ },
+ {
+ case: "gives no answer when a config spreads a part into an expo entry, which Expo reads as the config",
+ files: {
+ "app.config.js": `module.exports = ({ config }) => ({ ...config, expo: { ...config.preview.expo } });`,
+ "app.json": JSON.stringify({
+ expo: {
+ extra: { eas: { projectId: ID_A } },
+ preview: { expo: { extra: { eas: { projectId: ID_B } } } },
+ },
+ }),
+ },
+ expected: Option.none(),
+ },
+ {
+ case: "gives no answer when a config spreads a part into a computed key",
+ files: {
+ "app.config.js": `module.exports = ({ config }) => ({ ...config, [[...config.keys]]: config.preview });`,
+ "app.json": JSON.stringify({
+ expo: {
+ keys: ["extra"],
+ extra: { eas: { projectId: ID_A } },
+ preview: { eas: { projectId: ID_B } },
+ },
+ }),
+ },
+ expected: Option.none(),
+ },
+ {
+ case: "gives no answer when a template line that only looks like a comment replaces extra",
+ files: {
+ "app.config.js": `module.exports = ({ config }) => {
+ const banner = \`
+/* \${(config.extra = config.preview.extra)} */\`;
+ return { ...config, name: banner };
+ };`,
+ "app.json": JSON.stringify({
+ expo: {
+ extra: { eas: { projectId: ID_A } },
+ preview: { extra: { eas: { projectId: ID_B } } },
+ },
+ }),
+ },
+ expected: Option.none(),
+ },
{
case: "reads a project id that follows spreads",
files: {
diff --git a/apps/server/src/device/easProjectId.ts b/apps/server/src/device/easProjectId.ts
index 528db26870ca5..e14f9d5871910 100644
--- a/apps/server/src/device/easProjectId.ts
+++ b/apps/server/src/device/easProjectId.ts
@@ -48,10 +48,21 @@ const HOLDER_AT = {
// `config` and no more of it: not an identifier continuing (`$`, Unicode
// letters and a `\u` escape do, where `\b` would not), nor a property.
const CONFIG_AT = new RegExp("config" + HOLDER_END, "uy");
+// A part of `config` other than `extra`, such as `config.ios`; the last name is
+// captured. Spread at the top it could bring its own `extra` (`...config.preview`).
+const CONFIG_PART_AT = new RegExp(
+ String.raw`config(?:\s*\??\.\s*(?!extra(?![\p{ID_Continue}$]))([\p{ID_Start}$_][\p{ID_Continue}$\u200c\u200d]*))+` +
+ HOLDER_END,
+ "uy",
+);
+// So a part keeps the id only as the first item of the object or array entry it
+// names (`ios: { ...config.ios`, `plugins: [...config.plugins`); the key is captured.
+const PART_OPENER =
+ /(?<=[{,]\s*["']?([\p{ID_Start}$_][\p{ID_Continue}$\u200c\u200d]*)["']?\s*:\s*[[{]\s*)/uy;
/**
- * Only Expo's `config` and its own `extra`/`extra.eas` spreads can preserve app.json's id.
- * Other spreads may replace it; no spreads leaves inheritance unclear.
+ * Only Expo's `config`, its own `extra`/`extra.eas`, and parts kept in their own entry can
+ * preserve app.json's id. Other spreads may replace it; no spreads leaves inheritance unclear.
* Skip comments whole after spreads to keep scanning linear.
*/
const staticConfigUse = (source: string): "spreads" | "replaces" | "unclear" => {
@@ -72,18 +83,24 @@ const staticConfigUse = (source: string): "spreads" | "replaces" | "unclear" =>
spreads++;
continue;
}
+ CONFIG_PART_AT.lastIndex = at;
+ const part = CONFIG_PART_AT.exec(source);
+ PART_OPENER.lastIndex = next;
+ const opener = part && PART_OPENER.exec(source);
+ // Expo reads a returned `expo` entry as the whole config.
+ if (opener && opener[1] === part[1] && opener[1] !== "expo") continue;
HOLDER_AT.extra.lastIndex = at;
HOLDER_AT.eas.lastIndex = at;
if (!HOLDER_AT.extra.test(source) && !HOLDER_AT.eas.test(source)) return "replaces";
}
};
const ASSIGNS_OVER = /\bObject\s*\.\s*assign\b|\bassign\s*\(/;
-// A config may replace the object holding the entry, or the whole config,
-// from somewhere this scan cannot read: an assignment to `.extra` or `.eas`,
-// (as a property or in brackets), a `delete` of anything, or another file it
-// requires or imports.
+// A config may replace its entry or itself from where this scan cannot read:
+// assigning `.extra` or `.eas` (dotted or bracketed), a `delete`, or a file it
+// requires or imports. Typing it as `import('expo/config').ConfigContext`, in a
+// comment or not, loads only Expo's own module.
const REPLACES_HOLDER =
- /(?:\.\s*(?:extra|eas)|\[\s*["'`](?:extra|eas)["'`]\s*\])\s*=(?!=)|\bdelete\b|\brequire\s*\(|\bimport\s*\(/;
+ /(?:\.\s*(?:extra|eas)|\[\s*["'`](?:extra|eas)["'`]\s*\])\s*=(?!=)|\bdelete\b|\brequire\s*\(|\bimport\s*\((?!\s*(["'])expo\/config\1\s*\)\s*\.\s*[A-Z])/;
// An `extra`/`eas` object must start by spreading the matching `config` entry to keep app.json's id.
// Spreading the whole config there puts the id elsewhere; shorthand entries replace it too.
// Stop reading once entries exceed MAX_MENTIONS.
From 7d12d21fb778b302e5e427e831254a112e11ca6e Mon Sep 17 00:00:00 2001
From: BelKed <66956532+BelKed@users.noreply.github.com>
Date: Sat, 14 Nov 2026 23:40:52 +0100
Subject: [PATCH 022/140] fix(web): browser dialog card sits above the page
---
apps/web/src/browser/BrowserDialogCard.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/web/src/browser/BrowserDialogCard.tsx b/apps/web/src/browser/BrowserDialogCard.tsx
index 288a3ca7a30d0..88583a661b2fa 100644
--- a/apps/web/src/browser/BrowserDialogCard.tsx
+++ b/apps/web/src/browser/BrowserDialogCard.tsx
@@ -19,7 +19,7 @@ export function BrowserDialogCard({
const [promptText, setPromptText] = useState(dialog.defaultValue);
return (