fix(opencode): handle child approvals, stops, and model catalogs (#8480)

This commit is contained in:
Theo Browne authored and GitHub committed 2026-08-28 15:17:59 -07:00
1 parent 0009aacdf1
commit cb49e5d720
42 files changed
+7889 -581

No files matched your search

+46
View File
@@ -57,6 +57,7 @@ import * as Option from "effect/Option";
import * as Path from "effect/Path";
import * as PubSub from "effect/PubSub";
import * as Queue from "effect/Queue";
import * as Ref from "effect/Ref";
import * as Schema from "effect/Schema";
import * as Stream from "effect/Stream";
import * as TestClock from "effect/testing/TestClock";
@@ -4918,6 +4919,51 @@ it.layer(NodeServices.layer)("server router seam", (it) => {
}).pipe(Effect.provide(NodeHttpServer.layerTest)),
);
it.effect("refreshes providers for each subscribeServerConfig connection", () =>
Effect.gen(function* () {
const refreshCalls = yield* Ref.make(0);
const firstRefreshDone = yield* Deferred.make<void>();
const secondRefreshDone = yield* Deferred.make<void>();
yield* buildAppUnderTest({
layers: {
providerRegistry: {
refresh: () =>
Ref.updateAndGet(refreshCalls, (count) => count + 1).pipe(
Effect.tap((count) =>
Deferred.succeed(
count === 1 ? firstRefreshDone : secondRefreshDone,
undefined,
).pipe(Effect.ignore),
),
Effect.as([]),
),
},
},
});
const wsUrl = yield* getWsServerUrl("/ws");
yield* Effect.scoped(
withWsRpcClient(wsUrl, (client) =>
Effect.gen(function* () {
yield* client[WS_METHODS.subscribeServerConfig]({}).pipe(Stream.runHead);
yield* Deferred.await(firstRefreshDone);
}),
),
);
yield* Effect.scoped(
withWsRpcClient(wsUrl, (client) =>
Effect.gen(function* () {
yield* client[WS_METHODS.subscribeServerConfig]({}).pipe(Stream.runHead);
yield* Deferred.await(secondRefreshDone);
}),
),
);
assert.equal(yield* Ref.get(refreshCalls), 2);
}).pipe(Effect.provide(NodeHttpServer.layerTest)),
);
it.effect("routes websocket resource telemetry through the subscription", () =>
Effect.gen(function* () {
yield* buildAppUnderTest();