bolt.diy/app
Chris Toshok 8d3a8eeb3a
use AsyncLocalStorageContextManager to propagate trace context around (#32)
I noticed that the `llm.chat.*_tokens` attributes weren't in spans, and it turns out none of the attributes from the wrapped function make it in.  only those added synchronously from within `wrapWithSpan` do.

A few things in play here:

1. Switch from `ZoneContextManager` (which doesn't work with native async/await) to `AsyncLocalStorageContextManager` (which does.)
2. (1) requires we use a pnpm patch, since wrangler requires that we import `async_hooks` statically, and the otel code `requires` it, and also requires that it's spelled `node:async_hooks`.
3. encode the payload we try to send _before_ doing the retry loop, so we don't re-encode for each attempt.
4. switch from `startActiveSpan` to `context.with` + `startSpan`.  The latter allows us to wrap an async function.  the former is for synchronous functions.
2025-02-19 06:49:32 -08:00
..
components Followup fixes 2025-02-18 15:16:33 -08:00
lib use AsyncLocalStorageContextManager to propagate trace context around (#32) 2025-02-19 06:49:32 -08:00
routes otel changes 2025-02-18 12:40:44 -08:00
styles Update backend APIs for doing simulation based prompting (#7) 2025-01-20 08:03:25 -08:00
types feat: catch errors from web container preview and show in actionable alert so user can send them to AI for fixing (#856) 2024-12-25 03:05:44 +05:30
utils Avoid losing code when prompting AI (#24) 2025-02-13 09:36:22 -08:00
entry.client.tsx fix(browser-extensions): don't render directly in body 2024-10-07 10:49:31 +02:00
entry.server.tsx fix: updated logger and model caching minor bugfix #release (#895) 2024-12-31 22:47:32 +05:30
root.tsx Settings UI enhancement 2024-12-13 01:11:35 +01:00
vite-env.d.ts refactor: updated vite config to inject add version metadata into the app on build (#841) 2024-12-21 01:03:28 +05:30