Trouble with Tracing Spans in `runPromise` with Effect-TS

Hi all, effect-ts beginner here - trying to wrap the execute fn of tools that vercel ai-sdk is calling. This means I'm working w promises. I'm having trouble getting tracing to work (end goal is to get the tool calls in as spans). Is there something about runPromise that makes it so that spans cannot be collected? Along the lines below. Thanks!

// This hi span is collected
yield* Effect.succeed('hi').pipe(Effect.withSpan('hi'));

// the hi-in-promise span is not collected
yield* Effect.promise(() => {
  return Effect.runPromise(Effect.succeed('hi').pipe(Effect.withSpan('hi-in-promise')));
});
Was this page helpful?