Skip to content

Commit 4c4fb2b

Browse files
committed
Merge commit 'be56049fd6f170b2e32816017c4dd305821f4f24' into fix/779-turn-item-history-growth
2 parents 9e83790 + be56049 commit 4c4fb2b

28 files changed

Lines changed: 682 additions & 743 deletions

‎apps/desktop/src/app/DesktopAppErrors.test.ts‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎apps/desktop/src/app/DesktopDetachedActionErrors.test.ts‎

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎apps/desktop/src/backend/DesktopBackendPool.test.ts‎

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { assert, describe, it } from "@effect/vitest";
2-
import * as Duration from "effect/Duration";
32
import * as Effect from "effect/Effect";
43
import * as FileSystem from "effect/FileSystem";
54
import * as Layer from "effect/Layer";
@@ -19,29 +18,7 @@ import * as DesktopWindow from "../window/DesktopWindow.ts";
1918
import * as DesktopWslEnvironment from "../wsl/DesktopWslEnvironment.ts";
2019
import * as DesktopBackendConfiguration from "./DesktopBackendConfiguration.ts";
2120
import * as DesktopBackendPool from "./DesktopBackendPool.ts";
22-
import type { DesktopBackendSnapshot, DesktopBackendStartConfig } from "./DesktopBackendManager.ts";
23-
24-
function makeStubInstance(
25-
id: DesktopBackendPool.BackendInstanceId,
26-
label: string,
27-
): DesktopBackendPool.DesktopBackendInstance {
28-
const snapshot: DesktopBackendSnapshot = {
29-
desiredRunning: false,
30-
ready: false,
31-
activePid: Option.none(),
32-
restartAttempt: 0,
33-
restartScheduled: false,
34-
};
35-
return {
36-
id,
37-
label: Effect.succeed(label),
38-
start: Effect.void,
39-
stop: () => Effect.void,
40-
currentConfig: Effect.succeed(Option.none<DesktopBackendStartConfig>()),
41-
snapshot: Effect.succeed(snapshot),
42-
waitForReady: (_timeout: Duration.Duration) => Effect.succeed(false),
43-
};
44-
}
21+
import type { DesktopBackendStartConfig } from "./DesktopBackendManager.ts";
4522

4623
function layerPool(labelRef: Ref.Ref<string>): Layer.Layer<DesktopBackendPool.DesktopBackendPool> {
4724
return DesktopBackendPool.layer.pipe(
@@ -111,36 +88,6 @@ function layerPool(labelRef: Ref.Ref<string>): Layer.Layer<DesktopBackendPool.De
11188
}
11289

11390
describe("DesktopBackendPool", () => {
114-
it.effect("layerTest exposes registered instances by id", () =>
115-
Effect.gen(function* () {
116-
const pool = yield* DesktopBackendPool.DesktopBackendPool;
117-
const fetchedPrimary = yield* pool.get(DesktopBackendPool.PRIMARY_INSTANCE_ID);
118-
const fetchedWsl = yield* pool.get(DesktopBackendPool.BackendInstanceId("wsl:ubuntu"));
119-
const fetchedMissing = yield* pool.get(DesktopBackendPool.BackendInstanceId("missing"));
120-
const all = yield* pool.list;
121-
const resolvedPrimary = yield* pool.primary;
122-
123-
assert.equal(yield* Option.getOrThrow(fetchedPrimary).label, "Windows");
124-
assert.equal(yield* Option.getOrThrow(fetchedWsl).label, "WSL (Ubuntu)");
125-
assert.isTrue(Option.isNone(fetchedMissing));
126-
assert.lengthOf(all, 2);
127-
assert.equal(resolvedPrimary.id, DesktopBackendPool.PRIMARY_INSTANCE_ID);
128-
}).pipe(
129-
Effect.provide(
130-
DesktopBackendPool.layerTest([
131-
makeStubInstance(DesktopBackendPool.PRIMARY_INSTANCE_ID, "Windows"),
132-
makeStubInstance(DesktopBackendPool.BackendInstanceId("wsl:ubuntu"), "WSL (Ubuntu)"),
133-
]),
134-
),
135-
),
136-
);
137-
138-
it.effect("layerTest dies when no instances are supplied", () =>
139-
Effect.exit(
140-
DesktopBackendPool.DesktopBackendPool.pipe(Effect.provide(DesktopBackendPool.layerTest([]))),
141-
).pipe(Effect.map((exit) => assert.equal(exit._tag, "Failure"))),
142-
);
143-
14491
it.effect("resolves the primary label lazily after pool layer construction", () =>
14592
Effect.scoped(
14693
Effect.gen(function* () {

‎apps/mobile/src/features/connection/ConnectionFormField.test.tsx‎

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,9 @@
11
import { describe, expect, it } from "vite-plus/test";
22

3-
import { nativeHeaderScrollEdgeEffects, nativeTopScrollEdgeEffect } from "./scrollEdgeEffects";
3+
import { nativeTopScrollEdgeEffect } from "./scrollEdgeEffects";
44

55
describe("nativeTopScrollEdgeEffect", () => {
6-
it("keeps the automatic native treatment on iOS 26", () => {
7-
expect(nativeTopScrollEdgeEffect("ios", "26.5")).toBe("automatic");
8-
});
9-
10-
it("keeps UIKit automatic scroll-edge sampling on iOS 27 and later", () => {
6+
it("keeps UIKit content sampling instead of a local soft overlay on iOS 27", () => {
117
expect(nativeTopScrollEdgeEffect("ios", "27.0")).toBe("automatic");
12-
expect(nativeTopScrollEdgeEffect("ios", 28)).toBe("automatic");
13-
});
14-
15-
it("does not apply the iOS workaround to other platforms", () => {
16-
expect(nativeTopScrollEdgeEffect("android", 27)).toBe("automatic");
17-
});
18-
});
19-
20-
describe("nativeHeaderScrollEdgeEffects", () => {
21-
it("keeps non-top header edges hidden while applying the platform top effect", () => {
22-
expect(nativeHeaderScrollEdgeEffects("ios", "27.0")).toEqual({
23-
top: "automatic",
24-
bottom: "hidden",
25-
left: "hidden",
26-
right: "hidden",
27-
});
288
});
299
});

‎apps/mobile/src/state/thread-order.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe("shared mobile pending move", () => {
9090
expect(getPendingThreadOrder()).toBeNull();
9191
});
9292

93-
it.each(["failure", "interruption"])("releases a %s without restoring old canonical keys", () => {
93+
it("releases a cancelled move without restoring old canonical keys", () => {
9494
const { start, upsert } = fixture();
9595
const move = start();
9696
upsert("b", "aa");

‎apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts‎

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,11 @@ import { assert, describe, it } from "@effect/vitest";
1515
import {
1616
CheckpointId,
1717
EnvironmentId,
18-
MessageId,
1918
type ModelSelection,
20-
NodeId,
21-
ProjectId,
2219
ProviderDriverKind,
2320
ProviderInstanceId,
2421
ProviderSessionId,
2522
ProviderThreadId,
26-
RunAttemptId,
27-
RunId,
2823
ThreadId,
2924
type OrchestrationV2ProviderThread,
3025
type ProviderOptionDescriptor,
@@ -73,6 +68,7 @@ import {
7368
} from "@t3tools/provider-grok/testing";
7469
import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator";
7570
import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter";
71+
import { makeTurnInput } from "./AcpAdapterV2.testkit.ts";
7672
import type * as ProviderContinuationRequests from "@t3tools/provider-core/server/ProviderContinuationRequests";
7773
import {
7874
AcpProviderCapabilitiesV2,
@@ -540,69 +536,6 @@ const pollProtocolMethods = (events: Queue.Queue<EffectAcpProtocol.AcpProtocolLo
540536
return methods;
541537
});
542538

543-
function makeTurnInput(input: {
544-
readonly threadId: ThreadId;
545-
readonly providerThread: OrchestrationV2ProviderThread;
546-
readonly instanceId: ProviderInstanceId;
547-
readonly runtimePolicy: ProviderAdapter.ProviderAdapterV2RuntimePolicy;
548-
readonly now: DateTime.Utc;
549-
readonly ordinal?: number;
550-
readonly modelSelection?: ModelSelection;
551-
readonly messageCreatedBy?: "user" | "agent";
552-
readonly messageCreationSource?: "web" | "mobile" | "mcp" | "provider" | "server";
553-
readonly messageText?: string;
554-
}): ProviderAdapter.ProviderAdapterV2TurnInput {
555-
const ordinal = input.ordinal ?? 1;
556-
const suffix = `${input.threadId}:${ordinal}`;
557-
const modelSelection =
558-
input.modelSelection ?? ({ instanceId: input.instanceId, model: "default" } as const);
559-
return {
560-
appThread: {
561-
createdBy: "user",
562-
creationSource: "web",
563-
id: input.threadId,
564-
projectId: ProjectId.make(`project:${input.threadId}`),
565-
title: "ACP adapter test",
566-
providerInstanceId: input.instanceId,
567-
modelSelection,
568-
runtimeMode: "approval-required",
569-
interactionMode: "default",
570-
branch: null,
571-
worktreePath: null,
572-
activeProviderThreadId: input.providerThread.id,
573-
lineage: {
574-
parentThreadId: null,
575-
relationshipToParent: null,
576-
rootThreadId: input.threadId,
577-
},
578-
forkedFrom: null,
579-
createdAt: input.now,
580-
updatedAt: input.now,
581-
archivedAt: null,
582-
settledOverride: null,
583-
settledAt: null,
584-
lastVisitedAt: null,
585-
deletedAt: null,
586-
},
587-
threadId: input.threadId,
588-
runId: RunId.make(`run:${suffix}`),
589-
runOrdinal: ordinal,
590-
providerTurnOrdinal: ordinal,
591-
attemptId: RunAttemptId.make(`attempt:${suffix}`),
592-
rootNodeId: NodeId.make(`node:${suffix}`),
593-
providerThread: input.providerThread,
594-
message: {
595-
createdBy: input.messageCreatedBy ?? "user",
596-
creationSource: input.messageCreationSource ?? "web",
597-
messageId: MessageId.make(`message:${suffix}`),
598-
text: input.messageText ?? "test prompt",
599-
attachments: [],
600-
},
601-
modelSelection,
602-
runtimePolicy: input.runtimePolicy,
603-
};
604-
}
605-
606539
describe("AcpAdapterV2", () => {
607540
it.live.each(["failed", "recovered", "completed", "cancelled"] as const)(
608541
"projects Mistral retry notices and their %s outcome",

0 commit comments

Comments
 (0)