Conversation
ALS capture/restore in sse(), stream(), and websocket() handlers is unnecessary — all context (logger, session, auth, etc.) is available through c.var which Hono passes through naturally. The only ALS consumers (runInAgentContext, StandaloneAgentContext.invoke) create their own ALS scopes. This simplifies the handlers by removing the getAgentAsyncLocalStorage import and the capturedContext branching logic, while keeping the ROOT_CONTEXT OTel workaround for the Bun fetch+stream bug intact.
…t open Per OTel conventions, spans should be short-lived. The HTTP upgrade request is a discrete event that completes in milliseconds — keeping a span open for the entire WS connection lifetime (minutes/hours) is non-standard, causes memory leaks in OTel exporters, and produces useless telemetry in backends like Jaeger. Now the upgrade span ends immediately with the upgrade duration and status. Session finalization (save session/thread, send complete event) still defers until WebSocket close via waitUntil, but no longer holds a span open while waiting. Per-message spans (onOpen/onMessage/onClose) can be added as a future enhancement, linked to the original trace.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 Coding Plan
Comment Tip CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required. |
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-postgres-1.0.39-ff15785.tgz",
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-schema-1.0.39-ff15785.tgz",
"@agentuity/workbench": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-workbench-1.0.39-ff15785.tgz",
"@agentuity/auth": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-auth-1.0.39-ff15785.tgz",
"@agentuity/frontend": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-frontend-1.0.39-ff15785.tgz",
"@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-claude-code-1.0.39-ff15785.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-opencode-1.0.39-ff15785.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-runtime-1.0.39-ff15785.tgz",
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-cli-1.0.39-ff15785.tgz",
"@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-server-1.0.39-ff15785.tgz",
"@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-coder-1.0.39-ff15785.tgz",
"@agentuity/react": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-react-1.0.39-ff15785.tgz",
"@agentuity/evals": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-evals-1.0.39-ff15785.tgz",
"@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-drizzle-1.0.39-ff15785.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-core-1.0.39-ff15785.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-postgres-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-schema-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-workbench-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-auth-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-frontend-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-claude-code-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-opencode-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-runtime-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-cli-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-server-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-coder-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-react-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-evals-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-drizzle-1.0.39-ff15785.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-core-1.0.39-ff15785.tgz |
This comment has been minimized.
This comment has been minimized.
Bun's node:http has 4 bugs that prevent Vite's built-in http-proxy from proxying WebSocket upgrades: 1. socket.write() silently drops data (oven-sh/bun#9882) 2. Missing destroySoon on upgrade sockets (oven-sh/bun#24127) 3. http.request doesn't emit 'upgrade' for 101 (oven-sh/bun#9911) 4. HTTP parser doesn't hand off after upgrade (oven-sh/bun#28157) This adds a lightweight net.createServer TCP proxy on the user-facing port that peeks at each connection's first bytes and routes: - WebSocket upgrades to backend paths → directly to Bun (native WS works) - Everything else (HTTP, HMR) → to Vite on an internal port Architecture: net.Server(:3500) → Vite(:3502) + Bun(:3501) From the browser's perspective there is only one port. This can be removed once the upstream Bun PRs are merged.
…outing - Add devAnalyticsPlugin that injects window.__AGENTUITY_ANALYTICS__ config and analytics/session script tags into HTML during dev mode - Pass workbenchPath to spaFallbackPlugin so /workbench is not caught by the SPA fallback and properly proxied to Bun backend - Add analytics: true and workbench: '/workbench' to e2e test app.ts to match what agentuity.config.ts declares E2E results: 66 passed, 0 failed (from 50 failed before this PR)
The global setup only checked that Vite serves HTML, but on CI the Bun backend (port 3501) starts slightly later. Tests that depend on backend routes (analytics scripts, workbench API) would fail with ECONNREFUSED. Add a readiness check for /_agentuity/webanalytics/analytics.js which is served by the Bun backend, ensuring both Vite and Bun are ready before tests begin.
Two v2 regressions that broke production builds (CI integration + cloud deploy): 1. isDevelopment() returned true when NODE_ENV was unset, causing registerWebRoutes to skip. Changed to check === 'development' instead of !== 'production', since the dev server always sets NODE_ENV=development. 2. registerWebRoutes used process.cwd() to find .agentuity/client/, but the CI script runs from inside .agentuity/ so the path was wrong. Now resolves relative to import.meta.dir (the built app.js location) with fallback to process.cwd()/.agentuity/client.
…workbench test In dev mode, the metadata file is generated by the CLI dev server AFTER createApp() has already loaded the runtime. The metadata cache was set to 'not found' on first access and never retried, causing the workbench metadata endpoint to permanently return 500. Fix: skip caching 'not found' when NODE_ENV=development, so subsequent requests re-check the filesystem. Also update the workbench E2E test to poll the metadata endpoint until it returns 200, matching the dev server's async generation behavior.
|
Found 3 test failures on Blacksmith runners: Failures
|
No description provided.