Skip to content

Commit 077759d

Browse files
only21milclaude
andcommitted
fix(server): fit the ACP history import to current main
Main renamed the provider adapter registry layer (#26238), changed layerWsRpc to take four arguments and need ScratchThreadPromotion (#26767), and caps comment blocks at four lines (#21514). The importer layer, the ACP session RPC test and the importNativeHistory docblock follow suit. The pending-history browser test now asserts through expect.element, as AGENTS.md asks of browser tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a02c74a commit 077759d

4 files changed

Lines changed: 10 additions & 12 deletions

File tree

‎apps/server/src/orchestration-v2/runtimeLayer.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ const layerAgentSessionImporterProvided = AgentSessionImporter.layer.pipe(
243243
layerEventSink,
244244
IdAllocator.layer,
245245
ProviderSessionRuntime.layer,
246-
layerProviderAdapterRegistryProvided,
246+
ProviderAdapterRegistry.layerFromProviderInstanceRegistry,
247247
ThreadCommandExecutor.layer,
248248
),
249249
),

‎apps/server/src/project/AgentSessionImporter.ts‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,12 +421,10 @@ const make = Effect.gen(function* () {
421421
});
422422

423423
/**
424-
* A thread bound to an existing native session starts empty. Loading the
425-
* session replays its history only into the adapter's own snapshot, so copy
426-
* that snapshot into the thread as run-less history, as transcript imports do.
427-
* The `v1_import` origin it sets is what forks read to keep that history, and
428-
* marks the import done, so a call after a failed read repairs the thread and
429-
* any later call does nothing.
424+
* Loading a native session replays its history only into the adapter's own
425+
* snapshot, so copy that snapshot into the thread as run-less history. The
426+
* `v1_import` origin keeps it in forks and marks the import done, so a call
427+
* after a failed read repairs the thread and any later call does nothing.
430428
*/
431429
const importNativeHistory = Effect.fn("importNativeHistoryV2")(function* (input: {
432430
readonly threadId: ThreadId;

‎apps/server/src/ws.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,7 @@ it.effect("ACP session RPCs list a thread missing its history and repair it on i
11281128
Layer.mock(RemoteOpenTargets.RemoteOpenTargets)({}),
11291129
Layer.mock(DirectEndpoints.DirectEndpoints)({}),
11301130
Layer.mock(ManagedProjectFolders.ManagedProjectFolders)({ namedProjectsRoot: "/unused" }),
1131+
Layer.mock(ScratchThreadPromotion.ScratchThreadPromotion)({}),
11311132
Layer.mock(ServerEnvironment.ServerEnvironment)({}),
11321133
Layer.mock(EnvironmentAuth.EnvironmentAuth)({}),
11331134
Layer.mock(ProjectService.ProjectService)({
@@ -1178,9 +1179,8 @@ it.effect("ACP session RPCs list a thread missing its history and repair it on i
11781179
scopes: [],
11791180
},
11801181
{},
1181-
{},
1182-
yield* PreviewAutomationBroker.PreviewAutomationBroker,
11831182
yield* ServerBrowser.ServerBrowser,
1183+
() => Effect.void,
11841184
).pipe(
11851185
Layer.provide(services),
11861186
Layer.merge(

‎apps/web/src/components/settings/AcpSessionManagementSection.browser.test.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ it("offers to import a pending thread's history but not to delete its session",
245245
});
246246
await using screen = await renderSection();
247247
await screen.click("List sessions");
248-
expect(screen.button("Delete").disabled).toBe(true);
248+
await expect.element(screen.button("Delete")).toBeDisabled();
249249
await screen.click("Import");
250250
expect(commands.import).toHaveBeenCalledOnce();
251-
expect(screen.button("Imported").disabled).toBe(true);
252-
expect(screen.button("Delete").disabled).toBe(true);
251+
await expect.element(screen.button("Imported")).toBeDisabled();
252+
await expect.element(screen.button("Delete")).toBeDisabled();
253253
});

0 commit comments

Comments
 (0)