Skip to content

chore: enable biome rules and remove eslint-disable comments#1256

Open
Huijiro wants to merge 11 commits intomainfrom
biome-fix-eletric-boogaloo
Open

chore: enable biome rules and remove eslint-disable comments#1256
Huijiro wants to merge 11 commits intomainfrom
biome-fix-eletric-boogaloo

Conversation

@Huijiro
Copy link
Copy Markdown
Member

@Huijiro Huijiro commented Mar 23, 2026

Summary

  • Enable 8 easy biome rules with auto-fix
  • Remove all eslint-disable/enable comments (migrated to biome)
  • Update biome schema to 2.4.8

Rules enabled

Rule Change
noUnusedTemplateLiteral Auto-fix: removes unnecessary template literals
useTemplate Auto-fix: string concat → template literals
useNodejsImportProtocol Auto-fix: adds node: prefix
useExponentiationOperator Auto-fix: Math.pow**
noUselessSwitchCase Auto-fix: removes redundant cases
noUselessUndefinedInitialization Auto-fix: removes let x = undefined
noUselessContinue Auto-fix: removes pointless continue
noControlCharactersInRegex Enabled with inline ignores for ANSI escape patterns

Files changed

  • 264 files changed
  • 521 insertions, 939 deletions

Summary by CodeRabbit

  • Chores
    • Strengthened linter configuration and updated Biome schema.
    • Modernized string formatting and Node import specifiers across the codebase with no runtime or behavioral changes.
    • Removed numerous legacy lint-suppression comments and cleaned up formatting for improved maintainability and consistency.

- Enable 8 easy biome rules with auto-fix:
  - noUnusedTemplateLiteral, useTemplate, useNodejsImportProtocol
  - useExponentiationOperator, noUselessSwitchCase
  - noUselessUndefinedInitialization, noUselessContinue
  - noControlCharactersInRegex (with inline ignores for ANSI patterns)

- Remove all eslint-disable/enable comments (migrated to biome)

- Update biome schema to 2.4.8
@agentuity-agent
Copy link
Copy Markdown

agentuity-agent bot commented Mar 23, 2026

The latest Agentuity deployment details.

Project Deployment Preview Updated (UTC)
docs 🟢 Ready (deploy_53542e4a48e8d6f6d3b60134ab3b70c1) - 2026-04-06T19:59:42Z

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 23, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Repo-wide stylistic and linting updates: converted many string concatenations to template literals or plain string literals, standardized Node core imports to node: specifiers, removed or replaced ESLint disables (some with Biome ignores), and applied small, behavior-preserving refactors across code, tests, and scripts.

Changes

Cohort / File(s) Summary
Biome Configuration
biome.json
Bumped schema to 2.4.8 and tightened multiple linter rules (e.g., useTemplate, useNodejsImportProtocol, useExponentiationOperator, noControlCharactersInRegex, noUselessSwitchCase).
Node built-ins → node: specifiers
apps/docs/scripts/generate-sandbox-scripts.ts, apps/testing/..., packages/cli/src/cmd/**, packages/vscode/src/**, packages/workbench/test-app/vite.config.ts, scripts/test-storage.ts, packages/postgres/test/...
Replaced bare built-in imports (fs, path, crypto, os, child_process, readline, http, https, etc.) with node:-prefixed specifiers. No runtime API changes.
String construction conversions
apps/docs/scripts/generate-markdown-files.ts, apps/docs/scripts/generate-nav-data.ts, many packages/cli/**, packages/runtime/**, packages/coder/**, packages/frontend/**, packages/core/**, scripts and tests (see raw summary)
Switched numerous concatenations to template literals or plain single-quoted strings for logs, truncation/preview labels, URLs/paths, and file-write args. Changes preserve emitted text and behavior.
File write newline normalization
packages/claude-code/src/install.ts, packages/cli/scripts/test-create-flow.ts, packages/cli/src/utils/dependency-checker.ts, packages/cli/src/config.ts, scripts/canary.ts, scripts/publish.ts, scripts/test-templates.ts, etc.
File-write calls now commonly use template literals that include trailing \n (e.g., ${JSON.stringify(...)}\n), preserving content and newline semantics.
Lint suppression cleanup
many files across apps/, packages/cli/, packages/runtime/, packages/schema/, packages/react/, packages/core/, packages/frontend/, packages/server/, tests
Removed many inline and file-level ESLint no-explicit-any and related disables; in several areas replaced ESLint control-regex disables with biome-ignore comments. No type/cast semantics changed.
ESLint → Biome conversions for regexes
packages/cli/src/cmd/dev/templates.ts, packages/cli/src/terminal.ts, packages/cli/src/tui.ts, packages/cli/src/tui/box.ts, packages/coder/src/**, apps/docs/src/api/sandbox/route.ts
Replaced ESLint control-regex suppressions with biome-ignore directives for ANSI/control-character regexes; regex patterns and usage unchanged.
Behavior-preserving small refactors
packages/cli/src/errors.ts, packages/cli/src/cmd/build/ast.ts, packages/coder/src/remote-session.ts, packages/core/src/services/api.ts, packages/postgres/src/reconnect.ts, packages/runtime/src/session.ts, packages/runtime/src/agent.ts, packages/runtime/src/middleware.ts, packages/schema/src/base.ts
Minor internal edits: use ** instead of Math.pow, remove = undefined initializers, drop unused switch cases, adjust loop continue placements, and minor variable type/narrowing changes. Public APIs unchanged.
Generated code & build tooling
apps/docs/scripts/generate-nav-data.ts, packages/cli/src/cmd/build/entry-generator.ts, packages/cli/src/cmd/build/patch/index.ts, packages/cli/src/cmd/build/vite/registry-generator.ts, etc.
Normalized string assembly in generators and patchers (template vs. concatenation) and removed some eslint-disable comments in generated sections. Generation semantics unchanged.
Tests: imports, strings, lint directives
numerous test files under packages/cli/test/*, packages/core/test/*, packages/runtime/test/*, packages/react/test/*, packages/postgres/test/*, etc.
Adjusted core imports, string construction and removed ESLint suppressions in tests. Test assertions and control flow remain equivalent.
I/O / stream lazy-load change
packages/core/src/services/sandbox/run.ts
Lazily load node:stream PassThrough via dynamic import and cache; timing-log string literal minor change. No functional change to tee creation after load.
Miscellaneous formatting & minor logic edits
assorted files (see raw summary)
Various low-risk edits (string format changes, lint comment removals, small initializer tweaks) across the repo. No exported/public API signature changes reported.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

📦 Canary Packages Published

version: 2.0.9-56eef16

Packages
Package Version URL
@agentuity/migrate 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-migrate-2.0.9-56eef16.tgz
@agentuity/drizzle 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-drizzle-2.0.9-56eef16.tgz
@agentuity/schedule 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-schedule-2.0.9-56eef16.tgz
@agentuity/core 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-core-2.0.9-56eef16.tgz
@agentuity/webhook 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-webhook-2.0.9-56eef16.tgz
@agentuity/claude-code 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-claude-code-2.0.9-56eef16.tgz
@agentuity/workbench 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-workbench-2.0.9-56eef16.tgz
@agentuity/postgres 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-postgres-2.0.9-56eef16.tgz
@agentuity/auth 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-auth-2.0.9-56eef16.tgz
@agentuity/vector 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-vector-2.0.9-56eef16.tgz
@agentuity/task 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-task-2.0.9-56eef16.tgz
@agentuity/server 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-server-2.0.9-56eef16.tgz
@agentuity/keyvalue 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-keyvalue-2.0.9-56eef16.tgz
@agentuity/opencode 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-opencode-2.0.9-56eef16.tgz
@agentuity/runtime 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-runtime-2.0.9-56eef16.tgz
@agentuity/cli 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-cli-2.0.9-56eef16.tgz
@agentuity/queue 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-queue-2.0.9-56eef16.tgz
@agentuity/sandbox 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-sandbox-2.0.9-56eef16.tgz
@agentuity/frontend 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-frontend-2.0.9-56eef16.tgz
@agentuity/schema 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-schema-2.0.9-56eef16.tgz
@agentuity/coder-tui 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-coder-tui-2.0.9-56eef16.tgz
@agentuity/evals 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-evals-2.0.9-56eef16.tgz
@agentuity/db 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-db-2.0.9-56eef16.tgz
@agentuity/coder 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-coder-2.0.9-56eef16.tgz
@agentuity/react 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-react-2.0.9-56eef16.tgz
@agentuity/email 2.0.9-56eef16 https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-email-2.0.9-56eef16.tgz
Install

Add to your package.json:

{
  "dependencies": {
    "@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-migrate-2.0.9-56eef16.tgz",
    "@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-drizzle-2.0.9-56eef16.tgz",
    "@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-schedule-2.0.9-56eef16.tgz",
    "@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-core-2.0.9-56eef16.tgz",
    "@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-webhook-2.0.9-56eef16.tgz",
    "@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-claude-code-2.0.9-56eef16.tgz",
    "@agentuity/workbench": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-workbench-2.0.9-56eef16.tgz",
    "@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-postgres-2.0.9-56eef16.tgz",
    "@agentuity/auth": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-auth-2.0.9-56eef16.tgz",
    "@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-vector-2.0.9-56eef16.tgz",
    "@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-task-2.0.9-56eef16.tgz",
    "@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-server-2.0.9-56eef16.tgz",
    "@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-keyvalue-2.0.9-56eef16.tgz",
    "@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-opencode-2.0.9-56eef16.tgz",
    "@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-runtime-2.0.9-56eef16.tgz",
    "@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-cli-2.0.9-56eef16.tgz",
    "@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-queue-2.0.9-56eef16.tgz",
    "@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-sandbox-2.0.9-56eef16.tgz",
    "@agentuity/frontend": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-frontend-2.0.9-56eef16.tgz",
    "@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-schema-2.0.9-56eef16.tgz",
    "@agentuity/coder-tui": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-coder-tui-2.0.9-56eef16.tgz",
    "@agentuity/evals": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-evals-2.0.9-56eef16.tgz",
    "@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-db-2.0.9-56eef16.tgz",
    "@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-coder-2.0.9-56eef16.tgz",
    "@agentuity/react": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-react-2.0.9-56eef16.tgz",
    "@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-email-2.0.9-56eef16.tgz"
  }
}

Or install directly:

bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-migrate-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-drizzle-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-schedule-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-core-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-webhook-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-claude-code-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-workbench-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-postgres-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-auth-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-vector-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-task-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-server-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-keyvalue-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-opencode-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-runtime-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-cli-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-queue-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-sandbox-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-frontend-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-schema-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-coder-tui-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-evals-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-db-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-coder-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-react-2.0.9-56eef16.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/2.0.9-56eef16/agentuity-email-2.0.9-56eef16.tgz

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (9)
apps/docs/src/agent/agent_pulse/tools.ts (1)

35-35: Use StructuredError for this tool error path (Line 35).

Returning a raw string here bypasses the project’s standardized error shape. Prefer returning/throwing a StructuredError-based payload so agent tool failures are consistent with SDK patterns.

As per coding guidelines, "**/*.{ts,tsx}: Use StructuredError from @agentuity/core for error handling".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/src/agent/agent_pulse/tools.ts` at line 35, Replace the raw string
return "'Error fetching tutorial information'" with a StructuredError instance
from `@agentuity/core` (e.g., return/throw new StructuredError({ code:
'TOOL_ERROR', message: 'Error fetching tutorial information', details: <optional
details> })) and add the import for StructuredError at the top of the file;
ensure the tool function that currently returns that string (look for the
literal 'Error fetching tutorial information' in tools.ts) returns or throws the
StructuredError to match the project's standardized error shape.
packages/opencode/src/config/loader.ts (1)

120-120: Standardize catch-path handling with StructuredError (Line 120).

This catch path currently logs a plain warning and falls back. Consider wrapping/reporting this via StructuredError to keep error handling uniform across TypeScript modules.

As per coding guidelines, "**/*.{ts,tsx}: Use StructuredError from @agentuity/core for error handling".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/opencode/src/config/loader.ts` at line 120, Replace the plain
console.warn with a StructuredError from `@agentuity/core`: import StructuredError
and construct a new StructuredError with a descriptive message like "Could not
read Agentuity config", include the original error as the cause/metadata, and
then report it via the module's logger (e.g., processLogger.warn or equivalent)
so the code still falls back but the catch path is standardized; update the
catch in the loader function (where the console.warn appears) to use this
StructuredError wrapper instead of logging the raw error.
packages/cli/src/domain.ts (1)

193-193: Use the timeoutMs constant instead of hardcoding the timeout value.

The error message hardcodes "5 seconds" rather than deriving it from the timeoutMs constant (line 50). This creates a maintenance burden—if timeoutMs is changed, the error message will be incorrect.

♻️ Proposed fix to use the constant dynamically
-					error: 'DNS lookup timed out after 5 seconds. Please check your DNS configuration.',
+					error: `DNS lookup timed out after ${timeoutMs / 1000} seconds. Please check your DNS configuration.`,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/domain.ts` at line 193, The error message currently
hardcodes "5 seconds"; update the error string to derive the value from the
existing timeoutMs constant (declared as timeoutMs) so it stays correct when
changed—use a template expression that converts timeoutMs to seconds (e.g.,
timeoutMs / 1000) and injects that into the error property where error: 'DNS
lookup timed out after 5 seconds. Please check your DNS configuration.' is
defined.
packages/cli/scripts/test-concurrent-sessions.ts (1)

17-17: Prefer Bun.file().exists() over existsSync().

While not part of this PR's scope, the file uses existsSync() in multiple places (lines 87, 128, 144, 247). As per coding guidelines, Bun.file(f).exists() should be used instead for file existence checks in CLI packages.

♻️ Example refactor
-import { readdirSync, readFileSync, existsSync } from 'node:fs';
+import { readdirSync, readFileSync } from 'node:fs';

And replace usages like:

-	if (existsSync(LOGS_DIR)) {
+	if (await Bun.file(LOGS_DIR).exists()) {

Note: Since Bun.file().exists() is async, you may need to adjust the containing function signatures accordingly.

As per coding guidelines: "Use Bun.file(f).exists() instead of existsSync(f) for file existence checks" for packages/cli/**/*.ts files.

Also applies to: 87-87, 128-128, 144-144, 247-247

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/scripts/test-concurrent-sessions.ts` at line 17, This file uses
node:fs.existsSync; remove the existsSync import and replace every
existsSync(path) call in packages/cli/scripts/test-concurrent-sessions.ts with
await Bun.file(path).exists(); update the containing functions to be async (or
use an async IIFE/top-level await) so you can await the new async checks, ensure
any control flow that depended on synchronous results is preserved (await the
existence checks before proceeding), and remove the now-unused existsSync import
from the import list.
packages/frontend/src/analytics/beacon-standalone.ts (1)

357-357: Template literal conversions look good.

The string concatenation to template literal conversions are correct and align with the PR's useTemplate Biome rule objective.

Consider extracting duplicated visitor ID logic.

Both send() (line 357) and savePendingData() (line 483) contain identical logic for retrieving or generating the visitor ID. Consider extracting this into a helper function to reduce duplication:

♻️ Proposed refactor to eliminate duplication

Add a helper function near the top of the IIFE (after generateId()):

function getOrCreateVisitorId(): string {
	const vid = localStorage.getItem('agentuity_visitor_id') || `vid_${generateId()}`;
	try {
		localStorage.setItem('agentuity_visitor_id', vid);
	} catch {
		// Ignore
	}
	return vid;
}

Then simplify both locations:

 const s = getSession();
-const vid = localStorage.getItem('agentuity_visitor_id') || `vid_${generateId()}`;
-try {
-	localStorage.setItem('agentuity_visitor_id', vid);
-} catch {
-	// Ignore
-}
+const vid = getOrCreateVisitorId();

Also applies to: 483-483

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/frontend/src/analytics/beacon-standalone.ts` at line 357, Duplicate
visitor ID retrieval/generation appears in send() and savePendingData(); extract
into a helper. Create a function getOrCreateVisitorId() (placed near the IIFE
top, after generateId()) that encapsulates the logic: read localStorage key
'agentuity_visitor_id' or build `vid_${generateId()}`, attempt to persist it
with localStorage.setItem in a try/catch (ignore errors) and return the vid;
then replace the duplicated code in send() and savePendingData() with calls to
getOrCreateVisitorId().
apps/docs/scripts/generate-markdown-files.ts (1)

164-164: Inconsistent template literal usage.

The template literals embed concatenation operations (${preamble + links}) instead of using separate interpolations. For consistency and clarity, refactor to use distinct placeholders.

♻️ Proposed refactor
-	return `${preamble + links}\n`;
+	return `${preamble}${links}\n`;
-	return `${preamble + sections}\n`;
+	return `${preamble}${sections}\n`;

Also applies to: 207-207

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/scripts/generate-markdown-files.ts` at line 164, Replace the
concatenated interpolation `${preamble + links}` with separate placeholders or
simple concatenation to improve clarity: use either `${preamble}${links}\n` or
`preamble + links + '\n'` in the return statements where `preamble` and `links`
are combined (the occurrence at the return with `preamble` and `links`, and the
similar occurrence around line 207). Ensure both instances are updated to the
same clearer form.
packages/coder/src/index.ts (2)

729-731: Consider completing the template literal conversion.

The auto-fix converted the middle section to a template literal but left the outer parts as regular strings concatenated with +. For consistency with the useTemplate rule, consider converting the entire description to a single template literal.

♻️ Fully convert to template literal
-			description:
-				'Delegate a task to a specialized agent on your team. ' +
-				`Available agents: ${agentNames.join(', ')}. ` +
-				'Each agent runs independently with its own context window.',
+			description: `Delegate a task to a specialized agent on your team. Available agents: ${agentNames.join(', ')}. Each agent runs independently with its own context window.`,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/coder/src/index.ts` around lines 729 - 731, Convert the three
concatenated string pieces into one single template literal: replace the leading
and trailing quoted strings and the '+' operators with a single
backtick-delimited string that includes the existing interpolation
${agentNames.join(', ')} unchanged, preserving spaces, punctuation and the
trailing comma; this affects the description literal that currently spans
'Delegate a task...' + `Available agents: ${agentNames.join(', ')}. ` + 'Each
agent...', so make it a single template literal to satisfy the useTemplate rule.

935-936: Consider completing the template literal conversion.

Same pattern as the task tool above — the auto-fix partially converted to template literal but retained + concatenation. Consider converting to a single template literal for consistency.

♻️ Fully convert to template literal
-			description:
-				'Run multiple agent tasks concurrently (max 4). ' +
-				`Available agents: ${agentNames.join(', ')}.`,
+			description: `Run multiple agent tasks concurrently (max 4). Available agents: ${agentNames.join(', ')}.`,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/coder/src/index.ts` around lines 935 - 936, The string concatenation
mixes a plain string and a template literal; replace the concatenated pieces
with a single template literal so the description is consistent (e.g. combine
'Run multiple agent tasks concurrently (max 4). ' and `Available agents:
${agentNames.join(', ')}.` into one backtick-delimited template literal). Update
the expression that builds the tool description (the literal that references
agentNames.join(', ')) to a single template literal containing both sentences.
packages/cli/src/cmd/dev/index.ts (1)

1336-1339: Consider using tui.info() instead of console.log().

While the template literal formatting is correct, the showHelp() function uses raw console.log() calls for TUI output. As per coding guidelines, TUI output should use tui.* helpers instead of raw console methods.

♻️ Suggested refactor using tui helpers
 const showHelp = () => {
-	console.log(`\n${tui.bold('Keyboard Shortcuts:')}`);
-	console.log(`${tui.muted('  h')} - show this help`);
-	console.log(`${tui.muted('  c')} - clear console`);
-	console.log(`${tui.muted('  q')} - quit\n`);
+	tui.info(`${tui.bold('Keyboard Shortcuts:')}`);
+	tui.info(`${tui.muted('  h')} - show this help`);
+	tui.info(`${tui.muted('  c')} - clear console`);
+	tui.info(`${tui.muted('  q')} - quit`);
+	tui.newline();
 };

As per coding guidelines for command files, use tui.* helpers for formatted TUI output instead of raw console methods.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/cmd/dev/index.ts` around lines 1336 - 1339, Replace the raw
console.log calls in the showHelp output with the TUI helper methods: use
tui.info() for the main help header and lines, and keep tui.muted(...) where
formatting is needed (e.g., the small-key labels). Specifically, update the
three console.log invocations that print the Keyboard Shortcuts block (the lines
containing tui.bold('Keyboard Shortcuts:') and tui.muted('  h') / tui.muted(' 
c') / tui.muted('  q')) to call tui.info(...) (or tui.info/tui.muted
combinations) so all TUI output goes through the tui helpers rather than
console.log.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/cli/src/cmd/build/patch/index.ts`:
- Line 64: The export prefix construction currently appends export text causing
duplicates; in the block that constructs fnprefix when isAsync and isExport are
true (variables: fnprefix, isAsync, isExport), replace the append operation with
an assignment so fnprefix is set to `export ${fnprefix}` instead of using `+=`,
ensuring the prefix becomes "export async " rather than "async export async ".

In `@packages/frontend/src/websocket-manager.ts`:
- Line 19: The code currently throws a native Error in websocket-manager.ts (the
throw in the data-type handling branch: `throw new Error(...)`); replace this
with a StructuredError from `@agentuity/core` by importing StructuredError and
throwing new StructuredError(...) with the same message (and include a code or
metadata field if available) in the same branch (the data-type
validation/unsupported-data path) so the project-wide error type is used
consistently.

In `@packages/react/src/api.ts`:
- Line 858: The local variable streamError is declared too loosely as any;
narrow it to Error | undefined and initialize it accordingly so TypeScript
strict mode is satisfied. Locate the declaration of streamError (used with
processStream and its onError callback) and change its type from any to Error |
undefined, ensuring any assignments in the onError handler assign an Error and
any subsequent checks treat it as possibly undefined.

In `@packages/schema/src/base.ts`:
- Around line 69-70: The error message formatting can crash when a path segment
is a Symbol because .join('.') expects strings; update the mapping that builds
the path (the .map((p) => ...) before .join('.')) to explicitly convert every
segment to string (e.g., String(...)) and use a safe object-narrowing check (p
!== null && typeof p === 'object') when accessing
StandardSchemaV1.PathSegment.key so symbols, numbers, and strings are all
handled without throwing; ensure the final array passed to .join('.') is all
strings.

---

Nitpick comments:
In `@apps/docs/scripts/generate-markdown-files.ts`:
- Line 164: Replace the concatenated interpolation `${preamble + links}` with
separate placeholders or simple concatenation to improve clarity: use either
`${preamble}${links}\n` or `preamble + links + '\n'` in the return statements
where `preamble` and `links` are combined (the occurrence at the return with
`preamble` and `links`, and the similar occurrence around line 207). Ensure both
instances are updated to the same clearer form.

In `@apps/docs/src/agent/agent_pulse/tools.ts`:
- Line 35: Replace the raw string return "'Error fetching tutorial information'"
with a StructuredError instance from `@agentuity/core` (e.g., return/throw new
StructuredError({ code: 'TOOL_ERROR', message: 'Error fetching tutorial
information', details: <optional details> })) and add the import for
StructuredError at the top of the file; ensure the tool function that currently
returns that string (look for the literal 'Error fetching tutorial information'
in tools.ts) returns or throws the StructuredError to match the project's
standardized error shape.

In `@packages/cli/scripts/test-concurrent-sessions.ts`:
- Line 17: This file uses node:fs.existsSync; remove the existsSync import and
replace every existsSync(path) call in
packages/cli/scripts/test-concurrent-sessions.ts with await
Bun.file(path).exists(); update the containing functions to be async (or use an
async IIFE/top-level await) so you can await the new async checks, ensure any
control flow that depended on synchronous results is preserved (await the
existence checks before proceeding), and remove the now-unused existsSync import
from the import list.

In `@packages/cli/src/cmd/dev/index.ts`:
- Around line 1336-1339: Replace the raw console.log calls in the showHelp
output with the TUI helper methods: use tui.info() for the main help header and
lines, and keep tui.muted(...) where formatting is needed (e.g., the small-key
labels). Specifically, update the three console.log invocations that print the
Keyboard Shortcuts block (the lines containing tui.bold('Keyboard Shortcuts:')
and tui.muted('  h') / tui.muted('  c') / tui.muted('  q')) to call
tui.info(...) (or tui.info/tui.muted combinations) so all TUI output goes
through the tui helpers rather than console.log.

In `@packages/cli/src/domain.ts`:
- Line 193: The error message currently hardcodes "5 seconds"; update the error
string to derive the value from the existing timeoutMs constant (declared as
timeoutMs) so it stays correct when changed—use a template expression that
converts timeoutMs to seconds (e.g., timeoutMs / 1000) and injects that into the
error property where error: 'DNS lookup timed out after 5 seconds. Please check
your DNS configuration.' is defined.

In `@packages/coder/src/index.ts`:
- Around line 729-731: Convert the three concatenated string pieces into one
single template literal: replace the leading and trailing quoted strings and the
'+' operators with a single backtick-delimited string that includes the existing
interpolation ${agentNames.join(', ')} unchanged, preserving spaces, punctuation
and the trailing comma; this affects the description literal that currently
spans 'Delegate a task...' + `Available agents: ${agentNames.join(', ')}. ` +
'Each agent...', so make it a single template literal to satisfy the useTemplate
rule.
- Around line 935-936: The string concatenation mixes a plain string and a
template literal; replace the concatenated pieces with a single template literal
so the description is consistent (e.g. combine 'Run multiple agent tasks
concurrently (max 4). ' and `Available agents: ${agentNames.join(', ')}.` into
one backtick-delimited template literal). Update the expression that builds the
tool description (the literal that references agentNames.join(', ')) to a single
template literal containing both sentences.

In `@packages/frontend/src/analytics/beacon-standalone.ts`:
- Line 357: Duplicate visitor ID retrieval/generation appears in send() and
savePendingData(); extract into a helper. Create a function
getOrCreateVisitorId() (placed near the IIFE top, after generateId()) that
encapsulates the logic: read localStorage key 'agentuity_visitor_id' or build
`vid_${generateId()}`, attempt to persist it with localStorage.setItem in a
try/catch (ignore errors) and return the vid; then replace the duplicated code
in send() and savePendingData() with calls to getOrCreateVisitorId().

In `@packages/opencode/src/config/loader.ts`:
- Line 120: Replace the plain console.warn with a StructuredError from
`@agentuity/core`: import StructuredError and construct a new StructuredError with
a descriptive message like "Could not read Agentuity config", include the
original error as the cause/metadata, and then report it via the module's logger
(e.g., processLogger.warn or equivalent) so the code still falls back but the
catch path is standardized; update the catch in the loader function (where the
console.warn appears) to use this StructuredError wrapper instead of logging the
raw error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 324c95ab-4405-45c7-beec-fb278eabe45d

📥 Commits

Reviewing files that changed from the base of the PR and between 124e8ce and 700c516.

⛔ Files ignored due to path filters (11)
  • apps/docs/src/generated/app.ts is excluded by !**/generated/**
  • apps/testing/auth-package-app/src/generated/app.ts is excluded by !**/generated/**
  • apps/testing/cloud-deployment/src/generated/app.ts is excluded by !**/generated/**
  • apps/testing/e2e-web/src/generated/app.ts is excluded by !**/generated/**
  • apps/testing/integration-suite/src/generated/app.ts is excluded by !**/generated/**
  • apps/testing/nextjs-app/agentuity/src/generated/app.ts is excluded by !**/generated/**
  • apps/testing/oauth/src/generated/app.ts is excluded by !**/generated/**
  • apps/testing/svelte-web/src/generated/app.ts is excluded by !**/generated/**
  • apps/testing/tanstack-start/agentuity/src/generated/app.ts is excluded by !**/generated/**
  • apps/testing/vite-rsc-app/agentuity/src/generated/app.ts is excluded by !**/generated/**
  • apps/testing/webrtc-test/src/generated/app.ts is excluded by !**/generated/**
📒 Files selected for processing (253)
  • apps/docs/scripts/generate-markdown-files.ts
  • apps/docs/scripts/generate-nav-data.ts
  • apps/docs/scripts/generate-sandbox-scripts.ts
  • apps/docs/src/agent/agent_pulse/tools.ts
  • apps/docs/src/api/sandbox/route.ts
  • apps/docs/src/run/agent-calls.ts
  • apps/docs/src/web/components/ChatDemo.tsx
  • apps/docs/src/web/components/StreamingDemo.tsx
  • apps/docs/src/web/components/docs/mdx-components.tsx
  • apps/docs/src/web/routeTree.gen.ts
  • apps/testing/auth-package-app/src/agent/hello/agent.ts
  • apps/testing/auth-package-app/src/api/index.ts
  • apps/testing/auth-package-app/src/web/AuthDemo.tsx
  • apps/testing/db/index.ts
  • apps/testing/e2e-web/src/agent/counter/agent.ts
  • apps/testing/email/index.ts
  • apps/testing/integration-suite/src/agent/storage/binary/upload-download.ts
  • apps/testing/integration-suite/src/test/ai-sdk-gateway.ts
  • apps/testing/integration-suite/src/test/cli-env-pull.ts
  • apps/testing/integration-suite/src/test/cli-org-env-secrets.ts
  • apps/testing/integration-suite/src/test/helpers/cli.ts
  • apps/testing/integration-suite/src/test/storage-binary.ts
  • apps/testing/integration-suite/src/test/web-rendering.ts
  • apps/testing/nextjs-app/next.config.ts
  • apps/testing/queue/index.ts
  • apps/testing/schedule/index.ts
  • apps/testing/task/index.ts
  • apps/testing/vector/index.ts
  • apps/testing/vite-rsc-app/src/framework/entry.browser.tsx
  • apps/testing/webhook/index.ts
  • biome.json
  • packages/auth/src/agentuity/config.ts
  • packages/auth/src/agentuity/react.tsx
  • packages/auth/src/agentuity/server.ts
  • packages/auth/test/agentuity/server.test.ts
  • packages/claude-code/src/install.ts
  • packages/cli/bin/cli.ts
  • packages/cli/scripts/test-concurrent-sessions.ts
  • packages/cli/scripts/test-create-flow.ts
  • packages/cli/src/auth.ts
  • packages/cli/src/banner.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/cmd/ai/claude-code/install.ts
  • packages/cli/src/cmd/ai/claude-code/uninstall.ts
  • packages/cli/src/cmd/ai/detect.ts
  • packages/cli/src/cmd/ai/intro.ts
  • packages/cli/src/cmd/ai/schema/show.ts
  • packages/cli/src/cmd/auth/org/enroll.ts
  • packages/cli/src/cmd/auth/ssh/add.ts
  • packages/cli/src/cmd/auth/ssh/api.ts
  • packages/cli/src/cmd/build/app-router-detector.ts
  • packages/cli/src/cmd/build/ast.ts
  • packages/cli/src/cmd/build/entry-generator.ts
  • packages/cli/src/cmd/build/patch/aisdk.ts
  • packages/cli/src/cmd/build/patch/index.ts
  • packages/cli/src/cmd/build/vite/bun-dev-server.ts
  • packages/cli/src/cmd/build/vite/lifecycle-generator.ts
  • packages/cli/src/cmd/build/vite/metadata-generator.ts
  • packages/cli/src/cmd/build/vite/registry-generator.ts
  • packages/cli/src/cmd/build/vite/route-discovery.ts
  • packages/cli/src/cmd/build/vite/tailwind-source-plugin.ts
  • packages/cli/src/cmd/build/vite/vite-asset-server.ts
  • packages/cli/src/cmd/build/webanalytics-generator.ts
  • packages/cli/src/cmd/cloud/agent/get.ts
  • packages/cli/src/cmd/cloud/deploy.ts
  • packages/cli/src/cmd/cloud/env/env-diff.ts
  • packages/cli/src/cmd/cloud/env/list.ts
  • packages/cli/src/cmd/cloud/eval-run/list.ts
  • packages/cli/src/cmd/cloud/eval/list.ts
  • packages/cli/src/cmd/cloud/queue/dlq.ts
  • packages/cli/src/cmd/cloud/queue/stats.ts
  • packages/cli/src/cmd/cloud/region-lookup.ts
  • packages/cli/src/cmd/cloud/sandbox/fs/cp.ts
  • packages/cli/src/cmd/cloud/session/get.ts
  • packages/cli/src/cmd/cloud/session/list.ts
  • packages/cli/src/cmd/cloud/storage/config.ts
  • packages/cli/src/cmd/cloud/storage/delete.ts
  • packages/cli/src/cmd/cloud/storage/download.ts
  • packages/cli/src/cmd/cloud/storage/upload.ts
  • packages/cli/src/cmd/cloud/stream/create.ts
  • packages/cli/src/cmd/cloud/stream/get.ts
  • packages/cli/src/cmd/cloud/stream/list.ts
  • packages/cli/src/cmd/cloud/task/attachment.ts
  • packages/cli/src/cmd/cloud/task/create.ts
  • packages/cli/src/cmd/cloud/thread/list.ts
  • packages/cli/src/cmd/cloud/vector/get.ts
  • packages/cli/src/cmd/cloud/vector/search.ts
  • packages/cli/src/cmd/cloud/vector/stats.ts
  • packages/cli/src/cmd/coder/hub-url.ts
  • packages/cli/src/cmd/coder/inspect.ts
  • packages/cli/src/cmd/coder/list.ts
  • packages/cli/src/cmd/coder/start.ts
  • packages/cli/src/cmd/dev/api.ts
  • packages/cli/src/cmd/dev/index.ts
  • packages/cli/src/cmd/dev/templates.ts
  • packages/cli/src/cmd/index.ts
  • packages/cli/src/cmd/profile/show.ts
  • packages/cli/src/cmd/project/auth/init.ts
  • packages/cli/src/cmd/project/auth/shared.ts
  • packages/cli/src/cmd/project/download.ts
  • packages/cli/src/cmd/project/remote-import.ts
  • packages/cli/src/cmd/project/template-flow.ts
  • packages/cli/src/config.ts
  • packages/cli/src/domain.ts
  • packages/cli/src/env-util.ts
  • packages/cli/src/errors.ts
  • packages/cli/src/internal-logger.ts
  • packages/cli/src/log-collector.ts
  • packages/cli/src/repl.ts
  • packages/cli/src/schema-generator.ts
  • packages/cli/src/schema-parser.ts
  • packages/cli/src/steps.ts
  • packages/cli/src/terminal.ts
  • packages/cli/src/tsc-output-parser.ts
  • packages/cli/src/tui.ts
  • packages/cli/src/tui/box.ts
  • packages/cli/src/tui/group.ts
  • packages/cli/src/typescript-errors.ts
  • packages/cli/src/utils/dependency-checker.ts
  • packages/cli/src/utils/format.ts
  • packages/cli/src/utils/route-migration.ts
  • packages/cli/src/version-check.ts
  • packages/cli/test/build/ai-gateway-bundle.test.ts
  • packages/cli/test/build/ai-sdk-env-injection.test.ts
  • packages/cli/test/build/dev-server-bundle.test.ts
  • packages/cli/test/route-migration.test.ts
  • packages/cli/test/typescript-errors.test.ts
  • packages/coder/src/chain-preview.ts
  • packages/coder/src/client.ts
  • packages/coder/src/footer.ts
  • packages/coder/src/hub-overlay.ts
  • packages/coder/src/index.ts
  • packages/coder/src/output-viewer.ts
  • packages/coder/src/overlay.ts
  • packages/coder/src/remote-session.ts
  • packages/coder/src/remote-tui.ts
  • packages/coder/src/renderers.ts
  • packages/coder/src/review.ts
  • packages/core/src/error.ts
  • packages/core/src/services/api.ts
  • packages/core/src/services/monitoring/service.ts
  • packages/core/src/services/sandbox/run.ts
  • packages/core/src/services/task/service.ts
  • packages/core/src/standard_schema.ts
  • packages/core/test/adapter.test.ts
  • packages/core/test/error.test.ts
  • packages/core/test/json.test.ts
  • packages/core/test/keyvalue.test.ts
  • packages/drizzle/test/integration/tx-safety.ts
  • packages/evals/src/_utils.ts
  • packages/frontend/src/analytics/beacon-standalone.ts
  • packages/frontend/src/client/eventstream.ts
  • packages/frontend/src/client/index.ts
  • packages/frontend/src/reconnect.ts
  • packages/frontend/src/types.ts
  • packages/frontend/src/webrtc-manager.ts
  • packages/frontend/src/websocket-manager.ts
  • packages/frontend/test/eventstream-manager.test.ts
  • packages/frontend/test/websocket-manager.test.ts
  • packages/opencode/src/config/loader.ts
  • packages/opencode/src/plugin/plugin.ts
  • packages/opencode/src/sqlite/queries.ts
  • packages/opencode/src/tmux/manager.ts
  • packages/postgres/src/reconnect.ts
  • packages/postgres/test/integration/ssl-connection.ts
  • packages/postgres/test/integration/tx-safety.ts
  • packages/react/src/api.ts
  • packages/react/src/client.ts
  • packages/react/test/createClient.test.tsx
  • packages/react/test/matchers.d.ts
  • packages/react/test/useAPI-formats.test.tsx
  • packages/react/test/useAPI-params.test.tsx
  • packages/react/test/useEventStream.test.tsx
  • packages/react/test/useWebsocket.test.tsx
  • packages/runtime/src/_context.ts
  • packages/runtime/src/_events.ts
  • packages/runtime/src/_metadata.ts
  • packages/runtime/src/_process-protection.ts
  • packages/runtime/src/_server.ts
  • packages/runtime/src/_services.ts
  • packages/runtime/src/_standalone.ts
  • packages/runtime/src/_validation.ts
  • packages/runtime/src/agent.ts
  • packages/runtime/src/app.ts
  • packages/runtime/src/dev-patches/aisdk.ts
  • packages/runtime/src/dev-patches/otel-llm.ts
  • packages/runtime/src/devmode.ts
  • packages/runtime/src/eval.ts
  • packages/runtime/src/handlers/sse.ts
  • packages/runtime/src/handlers/stream.ts
  • packages/runtime/src/handlers/webrtc.ts
  • packages/runtime/src/handlers/websocket.ts
  • packages/runtime/src/index.ts
  • packages/runtime/src/middleware.ts
  • packages/runtime/src/otel/exporters/jsonl-metric-exporter.ts
  • packages/runtime/src/router.ts
  • packages/runtime/src/services/local/_router.ts
  • packages/runtime/src/services/local/stream.ts
  • packages/runtime/src/services/local/task.ts
  • packages/runtime/src/services/session/json.ts
  • packages/runtime/src/session.ts
  • packages/runtime/src/validator.ts
  • packages/runtime/src/web.ts
  • packages/runtime/src/workbench.ts
  • packages/runtime/test/base-app.test.ts
  • packages/runtime/test/compression.test.ts
  • packages/runtime/test/context-property-errors.test.ts
  • packages/runtime/test/evals.test.ts
  • packages/runtime/test/events.test.ts
  • packages/runtime/test/helpers/mock-context.ts
  • packages/runtime/test/helpers/mock-services.ts
  • packages/runtime/test/helpers/test-context.ts
  • packages/runtime/test/thread-id-header.test.ts
  • packages/runtime/test/validator.test.ts
  • packages/schema/src/base.ts
  • packages/schema/src/coerce/date.ts
  • packages/schema/src/complex/array.ts
  • packages/schema/src/complex/object.ts
  • packages/schema/src/complex/record.ts
  • packages/schema/src/index.ts
  • packages/schema/src/json-schema.ts
  • packages/schema/src/primitives/any.ts
  • packages/schema/src/primitives/string.ts
  • packages/schema/src/utils/nullable.ts
  • packages/schema/src/utils/optional.ts
  • packages/schema/src/utils/union.ts
  • packages/schema/test/json-schema.test.ts
  • packages/server/src/logger.ts
  • packages/server/src/schema.ts
  • packages/server/src/server.ts
  • packages/server/test/api.test.ts
  • packages/server/test/sandbox-client.test.ts
  • packages/test-utils/src/mock-fetch.ts
  • packages/vscode/src/core/cliClient.ts
  • packages/vscode/src/core/project.ts
  • packages/vscode/src/core/sandboxManager.ts
  • packages/vscode/src/features/agentExplorer/agentTreeData.ts
  • packages/vscode/src/features/agentExplorer/index.ts
  • packages/vscode/src/features/chat/agentTools.ts
  • packages/vscode/src/features/chat/agentuityParticipant.ts
  • packages/vscode/src/features/chat/contextProvider.ts
  • packages/vscode/src/features/codeLens/index.ts
  • packages/vscode/src/features/customAgents/index.ts
  • packages/vscode/src/features/dataExplorer/dataTreeData.ts
  • packages/vscode/src/features/dataExplorer/index.ts
  • packages/vscode/src/features/devServer/devServerManager.ts
  • packages/vscode/src/features/sandboxExplorer/index.ts
  • packages/vscode/src/features/sandboxExplorer/sandboxTreeData.ts
  • packages/workbench/test-app/vite.config.ts
  • scripts/canary.ts
  • scripts/publish.ts
  • scripts/test-storage.ts
  • scripts/test-templates.ts
💤 Files with no reviewable changes (78)
  • apps/docs/src/web/components/ChatDemo.tsx
  • apps/docs/src/web/components/StreamingDemo.tsx
  • apps/testing/auth-package-app/src/web/AuthDemo.tsx
  • apps/testing/e2e-web/src/agent/counter/agent.ts
  • packages/auth/src/agentuity/config.ts
  • packages/auth/src/agentuity/react.tsx
  • packages/auth/test/agentuity/server.test.ts
  • packages/cli/src/cmd/ai/schema/show.ts
  • packages/cli/src/cmd/build/app-router-detector.ts
  • packages/cli/src/cmd/build/vite/bun-dev-server.ts
  • packages/cli/src/cmd/index.ts
  • packages/cli/src/errors.ts
  • packages/cli/src/schema-generator.ts
  • packages/cli/src/schema-parser.ts
  • packages/cli/src/tsc-output-parser.ts
  • packages/cli/src/tui/group.ts
  • packages/cli/src/version-check.ts
  • packages/core/src/standard_schema.ts
  • packages/core/test/json.test.ts
  • packages/evals/src/_utils.ts
  • packages/frontend/src/types.ts
  • packages/frontend/src/webrtc-manager.ts
  • packages/frontend/test/eventstream-manager.test.ts
  • packages/frontend/test/websocket-manager.test.ts
  • packages/react/src/client.ts
  • packages/react/test/createClient.test.tsx
  • packages/react/test/matchers.d.ts
  • packages/react/test/useAPI-formats.test.tsx
  • packages/react/test/useAPI-params.test.tsx
  • packages/react/test/useEventStream.test.tsx
  • packages/react/test/useWebsocket.test.tsx
  • packages/runtime/src/_context.ts
  • packages/runtime/src/_events.ts
  • packages/runtime/src/_process-protection.ts
  • packages/runtime/src/_server.ts
  • packages/runtime/src/_validation.ts
  • packages/runtime/src/app.ts
  • packages/runtime/src/dev-patches/aisdk.ts
  • packages/runtime/src/dev-patches/otel-llm.ts
  • packages/runtime/src/eval.ts
  • packages/runtime/src/handlers/sse.ts
  • packages/runtime/src/handlers/stream.ts
  • packages/runtime/src/handlers/webrtc.ts
  • packages/runtime/src/handlers/websocket.ts
  • packages/runtime/src/index.ts
  • packages/runtime/src/router.ts
  • packages/runtime/src/services/local/_router.ts
  • packages/runtime/src/validator.ts
  • packages/runtime/src/workbench.ts
  • packages/runtime/test/evals.test.ts
  • packages/runtime/test/events.test.ts
  • packages/runtime/test/helpers/mock-services.ts
  • packages/runtime/test/helpers/test-context.ts
  • packages/runtime/test/validator.test.ts
  • packages/schema/src/coerce/date.ts
  • packages/schema/src/complex/array.ts
  • packages/schema/src/complex/object.ts
  • packages/schema/src/complex/record.ts
  • packages/schema/src/index.ts
  • packages/schema/src/primitives/any.ts
  • packages/schema/src/utils/nullable.ts
  • packages/schema/src/utils/optional.ts
  • packages/schema/test/json-schema.test.ts
  • packages/server/src/logger.ts
  • packages/test-utils/src/mock-fetch.ts
  • apps/docs/src/web/components/docs/mdx-components.tsx
  • apps/docs/src/web/routeTree.gen.ts
  • packages/cli/bin/cli.ts
  • packages/core/test/error.test.ts
  • packages/runtime/src/_services.ts
  • packages/server/test/api.test.ts
  • packages/runtime/test/helpers/mock-context.ts
  • packages/server/src/schema.ts
  • packages/schema/src/json-schema.ts
  • packages/schema/src/utils/union.ts
  • packages/runtime/src/_standalone.ts
  • packages/core/test/adapter.test.ts
  • packages/frontend/src/client/eventstream.ts

Huijiro added 2 commits March 23, 2026 18:02
- Fix logic error in patch/index.ts: change += to = for export prefix
- Use StructuredError in websocket-manager.ts instead of native Error
- Narrow streamError type from any to Error | undefined in react/api.ts
- Normalize path segments to strings before join() in schema/base.ts
@blacksmith-sh

This comment has been minimized.

Huijiro added 2 commits March 24, 2026 14:29
Use dynamic import for PassThrough in sandbox/run.ts, similar to how
error.ts handles node:util. This prevents bundler errors when building
for browser environments.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/core/src/services/sandbox/run.ts`:
- Around line 15-24: The lazy-loader in ensureNodeStreamLoaded currently sets
streamLoaded before the asynchronous import completes, causing race/poisoning;
change it to use a dedicated in-flight promise (e.g., streamLoadPromise) and
only set streamLoaded = true after import succeeds and PassThrough is assigned,
and wrap the import in try/catch so that on error you clear
streamLoadPromise/streamLoaded (or leave them unset) and rethrow the error; also
ensure callers await streamLoadPromise when present so concurrent calls wait for
the single import instead of proceeding while PassThrough is undefined.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b6e0a076-f795-43b0-ba27-9f5da88bcf70

📥 Commits

Reviewing files that changed from the base of the PR and between f3ade80 and 0f73d0f.

📒 Files selected for processing (1)
  • packages/core/src/services/sandbox/run.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
  • GitHub Check: Postgres SSL Integration Test
  • GitHub Check: Queue SDK Tests
  • GitHub Check: Framework Integration Tests (TanStack & Next.js)
  • GitHub Check: Standalone Agent Test
  • GitHub Check: SDK Integration Test Suite
  • GitHub Check: Template Integration Tests
  • GitHub Check: Queue CLI Tests
  • GitHub Check: Package Installation & Usage Test
  • GitHub Check: Storage CLI Tests
  • GitHub Check: Sandbox CLI Tests
  • GitHub Check: Cloud Deployment Tests
  • GitHub Check: Playwright E2E Smoke Test
  • GitHub Check: Build
  • GitHub Check: Pack & Upload
  • GitHub Check: Windows WSL CLI Smoke Test
  • GitHub Check: Agentuity Deployment
🧰 Additional context used
📓 Path-based instructions (3)
packages/core/src/**/*.ts

📄 CodeRabbit inference engine (packages/core/AGENTS.md)

packages/core/src/**/*.ts: Use TypeScript for all code in the @agentuity/core package
Prefer interfaces for public API definitions in @agentuity/core
Use generic types for reusable type utilities in @agentuity/core
Ensure no side effects in exports - all exports must be pure functions or types with no global mutations
Ensure code is compatible with both Browser and Node/Bun runtime environments

Files:

  • packages/core/src/services/sandbox/run.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Biome as code formatter with tabs (width 3), single quotes, semicolons, lineWidth 100, and trailingCommas es5

Files:

  • packages/core/src/services/sandbox/run.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use TypeScript Strict mode with ESNext target and bundler moduleResolution
Use StructuredError from @agentuity/core for error handling

Files:

  • packages/core/src/services/sandbox/run.ts
🧠 Learnings (1)
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.

Applied to files:

  • packages/core/src/services/sandbox/run.ts
🔇 Additional comments (1)
packages/core/src/services/sandbox/run.ts (1)

85-89: Nice cleanup on startup timing log and explicit pre-load await.

The plain string at Line 85 and explicit await ensureNodeStreamLoaded() at Line 88 improve readability and ordering.

Huijiro added 6 commits March 24, 2026 14:54
Use in-flight promise pattern to handle concurrent calls to ensureNodeStreamLoaded:
- Deduplicate concurrent loads via shared promise
- Wait for in-flight import instead of returning early
- Clear promise on error to allow retry
- Remove unused streamLoaded flag
…galoo

# Conflicts:
#	apps/docs/src/generated/app.ts
#	apps/testing/auth-package-app/src/generated/app.ts
#	apps/testing/cloud-deployment/src/generated/app.ts
#	apps/testing/e2e-web/src/generated/app.ts
#	apps/testing/integration-suite/src/generated/app.ts
#	apps/testing/nextjs-app/agentuity/src/generated/app.ts
#	apps/testing/svelte-web/src/generated/app.ts
#	apps/testing/tanstack-start/agentuity/src/generated/app.ts
#	apps/testing/vite-rsc-app/agentuity/src/generated/app.ts
#	apps/testing/webrtc-test/src/generated/app.ts
#	biome.json
#	packages/cli/src/cmd/build/app-router-detector.ts
#	packages/cli/src/cmd/build/ast.ts
#	packages/cli/src/cmd/build/entry-generator.ts
#	packages/cli/src/cmd/build/vite/bun-dev-server.ts
#	packages/cli/src/cmd/build/vite/lifecycle-generator.ts
#	packages/cli/src/cmd/build/vite/registry-generator.ts
#	packages/cli/src/cmd/build/vite/route-discovery.ts
#	packages/cli/src/cmd/build/vite/vite-asset-server.ts
#	packages/cli/src/cmd/build/webanalytics-generator.ts
#	packages/cli/src/cmd/coder/hub-url.ts
#	packages/cli/src/cmd/coder/list.ts
#	packages/cli/src/cmd/dev/index.ts
#	packages/cli/src/errors.ts
#	packages/cli/src/tui.ts
#	packages/cli/src/utils/route-migration.ts
#	packages/cli/test/build/dev-server-bundle.test.ts
#	packages/cli/test/route-migration.test.ts
#	packages/coder/src/index.ts
#	packages/frontend/src/client/eventstream.ts
#	packages/frontend/src/client/index.ts
#	packages/frontend/src/types.ts
#	packages/react/src/api.ts
#	packages/react/src/client.ts
#	packages/react/test/createClient.test.tsx
#	packages/react/test/useAPI-formats.test.tsx
#	packages/react/test/useAPI-params.test.tsx
#	packages/react/test/useEventStream.test.tsx
#	packages/react/test/useWebsocket.test.tsx
#	packages/runtime/src/_metadata.ts
#	packages/runtime/src/_process-protection.ts
#	packages/runtime/src/_services.ts
#	packages/runtime/src/_standalone.ts
#	packages/runtime/src/app.ts
#	packages/runtime/src/middleware.ts
#	packages/runtime/src/router.ts
#	packages/runtime/test/base-app.test.ts
#	packages/runtime/test/compression.test.ts
The noControlCharactersInRegex rule is now disabled in biome.json,
making all biome-ignore comments for it unnecessary.
Enabled rules (previously off):
- style/useImportType (115 fixes)
- style/noUnusedTemplateLiteral (60 fixes)
- style/useTemplate (46 fixes)
- style/useExponentiationOperator (0 - already clean)
- style/useNodejsImportProtocol (2 fixes)
- complexity/useLiteralKeys (238 fixes)
- complexity/useOptionalChain (38 fixes)
- complexity/noUselessSwitchCase (7 fixes)
- complexity/noUselessUndefinedInitialization (2 fixes)
- complexity/noUselessContinue (0 - already clean)
- suspicious/noEmptyInterface (5 fixes)
- suspicious/noConfusingVoidType (9 fixes)

All violations auto-fixed across 197 files.
…commended defaults

Removed rules that match biome's recommended defaults:
- noUnusedVariables (recommended: warn)
- noUnusedFunctionParameters (recommended: warn)
- noTemplateCurlyInString (recommended: warn)
- noDocumentCookie (recommended: warn)
- noAccumulatingSpread (recommended: warn)

Removed explicit 'off' for rules that are now enabled via recommended:
- useTemplate, useImportType, useNodejsImportProtocol, useExponentiationOperator
- useLiteralKeys, useOptionalChain, noUselessSwitchCase
- noUselessUndefinedInitialization, noUselessContinue
- noEmptyInterface, noConfusingVoidType

Changed noUnusedTemplateLiteral from 'off' to 'error' (not recommended, explicit opt-in).

Re-applied auto-fixes for all newly-enabled recommended rules.
…ned type change

The noConfusingVoidType rule replaced void with undefined in
EventEmitter generic types. Unlike void, undefined requires an
explicit argument to fire(). Updated all 7 call sites.
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