Skip to content

Feat/augment hono defaults#1183

Open
Huijiro wants to merge 9 commits intov2from
feat/augment-hono-defaults
Open

Feat/augment hono defaults#1183
Huijiro wants to merge 9 commits intov2from
feat/augment-hono-defaults

Conversation

@Huijiro
Copy link
Member

@Huijiro Huijiro commented Mar 12, 2026

No description provided.

Huijiro added 2 commits March 12, 2026 18:25
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.
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f042bf6f-a91c-4502-a5cb-f6c505c6c553

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

@agentuity-agent
Copy link

agentuity-agent bot commented Mar 12, 2026

The latest Agentuity deployment details. Learn more about Agentuity.

Project Deployment Preview Updated (UTC)
docs 🟡 Building - Mar 17, 2026 7:03 PM

@github-actions
Copy link

github-actions bot commented Mar 12, 2026

📦 Canary Packages Published

version: 1.0.39-ff15785

Packages
Package Version URL
@agentuity/postgres 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-postgres-1.0.39-ff15785.tgz
@agentuity/schema 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-schema-1.0.39-ff15785.tgz
@agentuity/workbench 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-workbench-1.0.39-ff15785.tgz
@agentuity/auth 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-auth-1.0.39-ff15785.tgz
@agentuity/frontend 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-frontend-1.0.39-ff15785.tgz
@agentuity/claude-code 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-claude-code-1.0.39-ff15785.tgz
@agentuity/opencode 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-opencode-1.0.39-ff15785.tgz
@agentuity/runtime 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-runtime-1.0.39-ff15785.tgz
@agentuity/cli 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-cli-1.0.39-ff15785.tgz
@agentuity/server 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-server-1.0.39-ff15785.tgz
@agentuity/coder 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-coder-1.0.39-ff15785.tgz
@agentuity/react 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-react-1.0.39-ff15785.tgz
@agentuity/evals 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-evals-1.0.39-ff15785.tgz
@agentuity/drizzle 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-drizzle-1.0.39-ff15785.tgz
@agentuity/core 1.0.39-ff15785 https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.39-ff15785/agentuity-core-1.0.39-ff15785.tgz
Install

Add to your package.json:

{
  "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

@blacksmith-sh

This comment has been minimized.

Huijiro added 6 commits March 17, 2026 12:17
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.
@blacksmith-sh
Copy link

blacksmith-sh bot commented Mar 17, 2026

Found 3 test failures on Blacksmith runners:

Failures

Test View Logs
[chromium] › e2e/
workbench.pw.ts:97:6 › Workbench Dev Mode › should persist thread state across agent ex
ecutions
View Logs
Click tracking works - Click event not found/
Click tracking works - Click event not found
View Logs
Pageview event logged - No pageview event found in console/
Pageview event logged - No pageview event found in console
View Logs

Fix in Cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant