History

fix runtime error

Rhys Sullivan committed 7 months ago

Commit d0065b01 parent cbb92e71 file · +13 −0Browse files

Unified · Split

packages/platform/sdk/src/runtime/execution/scope/tool-invoker.ts+13−0
@@ -73,6 +73,9 @@ import { · 72 unmodified lines
73import {73import {
74 loadRuntimeLocalScopePolicies,74 loadRuntimeLocalScopePolicies,
75} from "../../../policies/operations";75} from "../../../policies/operations";
76import {
77 RuntimeLocalScopeService,
78} from "../../scope/runtime-context";
76import {79import {
77 provideRuntimeLocalScope,80 provideRuntimeLocalScope,
78} from "./local";81} from "./local";
@@ -177,9 +180,19 @@ export const createScopeToolInvoker = (input: { · 98 unmodified lines
177 return catalog;180 return catalog;
178 },181 },
179 filterDiscoverResults: async (results: readonly DiscoverResultItem[]) => {182 filterDiscoverResults: async (results: readonly DiscoverResultItem[]) => {
183 if (!input.runtimeLocalScope) {
184 return results;
185 }
186
180 const { policies } = await Effect.runPromise(187 const { policies } = await Effect.runPromise(
181 loadRuntimeLocalScopePolicies(input.scopeId).pipe(188 loadRuntimeLocalScopePolicies(input.scopeId).pipe(
182 Effect.provide(persistedToolRuntimeLayer),189 Effect.provide(persistedToolRuntimeLayer),
190 Effect.provide(
191 Layer.succeed(
192 RuntimeLocalScopeService,
193 input.runtimeLocalScope,
194 ),
195 ),
183 ),196 ),
184 );197 );
185 198