mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
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. |
||
---|---|---|
.github | ||
.husky | ||
app | ||
docs | ||
functions | ||
icons | ||
patches | ||
public | ||
types | ||
.dockerignore | ||
.editorconfig | ||
.env.example | ||
.gitignore | ||
.prettierignore | ||
.prettierrc | ||
.tool-versions | ||
bindings.sh | ||
changelog.md | ||
CONTRIBUTING.md | ||
docker-compose.yaml | ||
Dockerfile | ||
eslint.config.mjs | ||
FAQ.md | ||
LICENSE | ||
load-context.ts | ||
package.json | ||
pnpm-lock.yaml | ||
pre-start.cjs | ||
PROJECT.md | ||
README.md | ||
tsconfig.json | ||
uno.config.ts | ||
vite.config.ts | ||
worker-configuration.d.ts | ||
wrangler.toml |
Nut
Nut is an open source fork of Bolt.new for helping you develop full stack apps using AI. AI developers frequently struggle with fixing even simple bugs when they don't know the cause, and get stuck making ineffective changes over and over. We want to crack these tough nuts, so to speak, so you can get back to building.
When you ask Nut to fix a bug, it creates a Replay.io recording of your app and whatever you did to produce the bug. The recording captures all the runtime behavior of your app, which is analyzed to explain the bug's root cause. This explanation is given to the AI developer so it has context to write a good fix.
Setup
pnpm install
pnpm build
./node_modules/.bin/wrangler pages dev