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
7373 import {
7474 loadRuntimeLocalScopePolicies,
7575 } from "../../../policies/operations";
76+import {
77+ RuntimeLocalScopeService,
78+} from "../../scope/runtime-context";
7679 import {
7780 provideRuntimeLocalScope,
7881 } from "./local";
@@ -177,9 +180,19 @@ export const createScopeToolInvoker = (input: { · 98 unmodified lines
177180 return catalog;
178181 },
179182 filterDiscoverResults: async (results: readonly DiscoverResultItem[]) => {
183+ if (!input.runtimeLocalScope) {
184+ return results;
185+ }
186+
180187 const { policies } = await Effect.runPromise(
181188 loadRuntimeLocalScopePolicies(input.scopeId).pipe(
182189 Effect.provide(persistedToolRuntimeLayer),
190+ Effect.provide(
191+ Layer.succeed(
192+ RuntimeLocalScopeService,
193+ input.runtimeLocalScope,
194+ ),
195+ ),
183196 ),
184197 );
185198