fix: provide EffectLogger.layer to bare Effect.runPromise/runFork calls (#21974)

This commit is contained in:
Kit Langton
2026-04-10 22:55:08 -04:00
committed by GitHub
parent b6af4d0dc6
commit 5917ac2162
11 changed files with 24 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
import path from "path"
import { Effect } from "effect"
import { EffectLogger } from "@/effect/logger"
import type { Tool } from "./tool"
import { Instance } from "../project/instance"
import { AppFileSystem } from "../filesystem"
@@ -42,5 +43,5 @@ export const assertExternalDirectoryEffect = Effect.fn("Tool.assertExternalDirec
})
export async function assertExternalDirectory(ctx: Tool.Context, target?: string, options?: Options) {
return Effect.runPromise(assertExternalDirectoryEffect(ctx, target, options))
return Effect.runPromise(assertExternalDirectoryEffect(ctx, target, options).pipe(Effect.provide(EffectLogger.layer)))
}

View File

@@ -30,6 +30,7 @@ import { Glob } from "../util/glob"
import path from "path"
import { pathToFileURL } from "url"
import { Effect, Layer, ServiceMap } from "effect"
import { EffectLogger } from "@/effect/logger"
import { FetchHttpClient, HttpClient } from "effect/unstable/http"
import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner"
import * as CrossSpawnSpawner from "@/effect/cross-spawn-spawner"
@@ -136,7 +137,7 @@ export namespace ToolRegistry {
Effect.gen(function* () {
const pluginCtx: PluginToolContext = {
...toolCtx,
ask: (req) => Effect.runPromise(toolCtx.ask(req)),
ask: (req) => Effect.runPromise(toolCtx.ask(req).pipe(Effect.provide(EffectLogger.layer))),
directory: ctx.directory,
worktree: ctx.worktree,
}

View File

@@ -2,6 +2,7 @@ import path from "path"
import { pathToFileURL } from "url"
import z from "zod"
import { Effect } from "effect"
import { EffectLogger } from "@/effect/logger"
import * as Stream from "effect/Stream"
import { Tool } from "./tool"
import { Skill } from "../skill"
@@ -18,7 +19,7 @@ export const SkillTool = Tool.define(
const rg = yield* Ripgrep.Service
return async () => {
const list = await Effect.runPromise(skill.available())
const list = await Effect.runPromise(skill.available().pipe(Effect.provide(EffectLogger.layer)))
const description =
list.length === 0