chore: enable biome rules and remove eslint-disable comments#1256
chore: enable biome rules and remove eslint-disable comments#1256
Conversation
- 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
|
The latest Agentuity deployment details.
|
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRepo-wide stylistic and linting updates: converted many string concatenations to template literals or plain string literals, standardized Node core imports to Changes
|
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-webhook-1.0.56-21b4978.tgz",
"@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-task-1.0.56-21b4978.tgz",
"@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-coder-1.0.56-21b4978.tgz",
"@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-db-1.0.56-21b4978.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-opencode-1.0.56-21b4978.tgz",
"@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-queue-1.0.56-21b4978.tgz",
"@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-vector-1.0.56-21b4978.tgz",
"@agentuity/react": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-react-1.0.56-21b4978.tgz",
"@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-keyvalue-1.0.56-21b4978.tgz",
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-schema-1.0.56-21b4978.tgz",
"@agentuity/evals": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-evals-1.0.56-21b4978.tgz",
"@agentuity/frontend": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-frontend-1.0.56-21b4978.tgz",
"@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-sandbox-1.0.56-21b4978.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-core-1.0.56-21b4978.tgz",
"@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-drizzle-1.0.56-21b4978.tgz",
"@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-postgres-1.0.56-21b4978.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-runtime-1.0.56-21b4978.tgz",
"@agentuity/workbench": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-workbench-1.0.56-21b4978.tgz",
"@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-claude-code-1.0.56-21b4978.tgz",
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-cli-1.0.56-21b4978.tgz",
"@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-email-1.0.56-21b4978.tgz",
"@agentuity/auth": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-auth-1.0.56-21b4978.tgz",
"@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-server-1.0.56-21b4978.tgz",
"@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-schedule-1.0.56-21b4978.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-webhook-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-task-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-coder-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-db-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-opencode-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-queue-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-vector-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-react-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-keyvalue-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-schema-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-evals-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-frontend-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-sandbox-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-core-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-drizzle-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-postgres-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-runtime-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-workbench-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-claude-code-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-cli-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-email-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-auth-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-server-1.0.56-21b4978.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/1.0.56-21b4978/agentuity-schedule-1.0.56-21b4978.tgz |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (9)
apps/docs/src/agent/agent_pulse/tools.ts (1)
35-35: UseStructuredErrorfor 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}: UseStructuredErrorfrom@agentuity/corefor 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 withStructuredError(Line 120).This catch path currently logs a plain warning and falls back. Consider wrapping/reporting this via
StructuredErrorto keep error handling uniform across TypeScript modules.As per coding guidelines, "
**/*.{ts,tsx}: UseStructuredErrorfrom@agentuity/corefor 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 thetimeoutMsconstant instead of hardcoding the timeout value.The error message hardcodes "5 seconds" rather than deriving it from the
timeoutMsconstant (line 50). This creates a maintenance burden—iftimeoutMsis 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: PreferBun.file().exists()overexistsSync().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 ofexistsSync(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
useTemplateBiome rule objective.Consider extracting duplicated visitor ID logic.
Both
send()(line 357) andsavePendingData()(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 theuseTemplaterule, 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
tasktool 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 usingtui.info()instead ofconsole.log().While the template literal formatting is correct, the
showHelp()function uses rawconsole.log()calls for TUI output. As per coding guidelines, TUI output should usetui.*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
⛔ Files ignored due to path filters (11)
apps/docs/src/generated/app.tsis excluded by!**/generated/**apps/testing/auth-package-app/src/generated/app.tsis excluded by!**/generated/**apps/testing/cloud-deployment/src/generated/app.tsis excluded by!**/generated/**apps/testing/e2e-web/src/generated/app.tsis excluded by!**/generated/**apps/testing/integration-suite/src/generated/app.tsis excluded by!**/generated/**apps/testing/nextjs-app/agentuity/src/generated/app.tsis excluded by!**/generated/**apps/testing/oauth/src/generated/app.tsis excluded by!**/generated/**apps/testing/svelte-web/src/generated/app.tsis excluded by!**/generated/**apps/testing/tanstack-start/agentuity/src/generated/app.tsis excluded by!**/generated/**apps/testing/vite-rsc-app/agentuity/src/generated/app.tsis excluded by!**/generated/**apps/testing/webrtc-test/src/generated/app.tsis excluded by!**/generated/**
📒 Files selected for processing (253)
apps/docs/scripts/generate-markdown-files.tsapps/docs/scripts/generate-nav-data.tsapps/docs/scripts/generate-sandbox-scripts.tsapps/docs/src/agent/agent_pulse/tools.tsapps/docs/src/api/sandbox/route.tsapps/docs/src/run/agent-calls.tsapps/docs/src/web/components/ChatDemo.tsxapps/docs/src/web/components/StreamingDemo.tsxapps/docs/src/web/components/docs/mdx-components.tsxapps/docs/src/web/routeTree.gen.tsapps/testing/auth-package-app/src/agent/hello/agent.tsapps/testing/auth-package-app/src/api/index.tsapps/testing/auth-package-app/src/web/AuthDemo.tsxapps/testing/db/index.tsapps/testing/e2e-web/src/agent/counter/agent.tsapps/testing/email/index.tsapps/testing/integration-suite/src/agent/storage/binary/upload-download.tsapps/testing/integration-suite/src/test/ai-sdk-gateway.tsapps/testing/integration-suite/src/test/cli-env-pull.tsapps/testing/integration-suite/src/test/cli-org-env-secrets.tsapps/testing/integration-suite/src/test/helpers/cli.tsapps/testing/integration-suite/src/test/storage-binary.tsapps/testing/integration-suite/src/test/web-rendering.tsapps/testing/nextjs-app/next.config.tsapps/testing/queue/index.tsapps/testing/schedule/index.tsapps/testing/task/index.tsapps/testing/vector/index.tsapps/testing/vite-rsc-app/src/framework/entry.browser.tsxapps/testing/webhook/index.tsbiome.jsonpackages/auth/src/agentuity/config.tspackages/auth/src/agentuity/react.tsxpackages/auth/src/agentuity/server.tspackages/auth/test/agentuity/server.test.tspackages/claude-code/src/install.tspackages/cli/bin/cli.tspackages/cli/scripts/test-concurrent-sessions.tspackages/cli/scripts/test-create-flow.tspackages/cli/src/auth.tspackages/cli/src/banner.tspackages/cli/src/cli.tspackages/cli/src/cmd/ai/claude-code/install.tspackages/cli/src/cmd/ai/claude-code/uninstall.tspackages/cli/src/cmd/ai/detect.tspackages/cli/src/cmd/ai/intro.tspackages/cli/src/cmd/ai/schema/show.tspackages/cli/src/cmd/auth/org/enroll.tspackages/cli/src/cmd/auth/ssh/add.tspackages/cli/src/cmd/auth/ssh/api.tspackages/cli/src/cmd/build/app-router-detector.tspackages/cli/src/cmd/build/ast.tspackages/cli/src/cmd/build/entry-generator.tspackages/cli/src/cmd/build/patch/aisdk.tspackages/cli/src/cmd/build/patch/index.tspackages/cli/src/cmd/build/vite/bun-dev-server.tspackages/cli/src/cmd/build/vite/lifecycle-generator.tspackages/cli/src/cmd/build/vite/metadata-generator.tspackages/cli/src/cmd/build/vite/registry-generator.tspackages/cli/src/cmd/build/vite/route-discovery.tspackages/cli/src/cmd/build/vite/tailwind-source-plugin.tspackages/cli/src/cmd/build/vite/vite-asset-server.tspackages/cli/src/cmd/build/webanalytics-generator.tspackages/cli/src/cmd/cloud/agent/get.tspackages/cli/src/cmd/cloud/deploy.tspackages/cli/src/cmd/cloud/env/env-diff.tspackages/cli/src/cmd/cloud/env/list.tspackages/cli/src/cmd/cloud/eval-run/list.tspackages/cli/src/cmd/cloud/eval/list.tspackages/cli/src/cmd/cloud/queue/dlq.tspackages/cli/src/cmd/cloud/queue/stats.tspackages/cli/src/cmd/cloud/region-lookup.tspackages/cli/src/cmd/cloud/sandbox/fs/cp.tspackages/cli/src/cmd/cloud/session/get.tspackages/cli/src/cmd/cloud/session/list.tspackages/cli/src/cmd/cloud/storage/config.tspackages/cli/src/cmd/cloud/storage/delete.tspackages/cli/src/cmd/cloud/storage/download.tspackages/cli/src/cmd/cloud/storage/upload.tspackages/cli/src/cmd/cloud/stream/create.tspackages/cli/src/cmd/cloud/stream/get.tspackages/cli/src/cmd/cloud/stream/list.tspackages/cli/src/cmd/cloud/task/attachment.tspackages/cli/src/cmd/cloud/task/create.tspackages/cli/src/cmd/cloud/thread/list.tspackages/cli/src/cmd/cloud/vector/get.tspackages/cli/src/cmd/cloud/vector/search.tspackages/cli/src/cmd/cloud/vector/stats.tspackages/cli/src/cmd/coder/hub-url.tspackages/cli/src/cmd/coder/inspect.tspackages/cli/src/cmd/coder/list.tspackages/cli/src/cmd/coder/start.tspackages/cli/src/cmd/dev/api.tspackages/cli/src/cmd/dev/index.tspackages/cli/src/cmd/dev/templates.tspackages/cli/src/cmd/index.tspackages/cli/src/cmd/profile/show.tspackages/cli/src/cmd/project/auth/init.tspackages/cli/src/cmd/project/auth/shared.tspackages/cli/src/cmd/project/download.tspackages/cli/src/cmd/project/remote-import.tspackages/cli/src/cmd/project/template-flow.tspackages/cli/src/config.tspackages/cli/src/domain.tspackages/cli/src/env-util.tspackages/cli/src/errors.tspackages/cli/src/internal-logger.tspackages/cli/src/log-collector.tspackages/cli/src/repl.tspackages/cli/src/schema-generator.tspackages/cli/src/schema-parser.tspackages/cli/src/steps.tspackages/cli/src/terminal.tspackages/cli/src/tsc-output-parser.tspackages/cli/src/tui.tspackages/cli/src/tui/box.tspackages/cli/src/tui/group.tspackages/cli/src/typescript-errors.tspackages/cli/src/utils/dependency-checker.tspackages/cli/src/utils/format.tspackages/cli/src/utils/route-migration.tspackages/cli/src/version-check.tspackages/cli/test/build/ai-gateway-bundle.test.tspackages/cli/test/build/ai-sdk-env-injection.test.tspackages/cli/test/build/dev-server-bundle.test.tspackages/cli/test/route-migration.test.tspackages/cli/test/typescript-errors.test.tspackages/coder/src/chain-preview.tspackages/coder/src/client.tspackages/coder/src/footer.tspackages/coder/src/hub-overlay.tspackages/coder/src/index.tspackages/coder/src/output-viewer.tspackages/coder/src/overlay.tspackages/coder/src/remote-session.tspackages/coder/src/remote-tui.tspackages/coder/src/renderers.tspackages/coder/src/review.tspackages/core/src/error.tspackages/core/src/services/api.tspackages/core/src/services/monitoring/service.tspackages/core/src/services/sandbox/run.tspackages/core/src/services/task/service.tspackages/core/src/standard_schema.tspackages/core/test/adapter.test.tspackages/core/test/error.test.tspackages/core/test/json.test.tspackages/core/test/keyvalue.test.tspackages/drizzle/test/integration/tx-safety.tspackages/evals/src/_utils.tspackages/frontend/src/analytics/beacon-standalone.tspackages/frontend/src/client/eventstream.tspackages/frontend/src/client/index.tspackages/frontend/src/reconnect.tspackages/frontend/src/types.tspackages/frontend/src/webrtc-manager.tspackages/frontend/src/websocket-manager.tspackages/frontend/test/eventstream-manager.test.tspackages/frontend/test/websocket-manager.test.tspackages/opencode/src/config/loader.tspackages/opencode/src/plugin/plugin.tspackages/opencode/src/sqlite/queries.tspackages/opencode/src/tmux/manager.tspackages/postgres/src/reconnect.tspackages/postgres/test/integration/ssl-connection.tspackages/postgres/test/integration/tx-safety.tspackages/react/src/api.tspackages/react/src/client.tspackages/react/test/createClient.test.tsxpackages/react/test/matchers.d.tspackages/react/test/useAPI-formats.test.tsxpackages/react/test/useAPI-params.test.tsxpackages/react/test/useEventStream.test.tsxpackages/react/test/useWebsocket.test.tsxpackages/runtime/src/_context.tspackages/runtime/src/_events.tspackages/runtime/src/_metadata.tspackages/runtime/src/_process-protection.tspackages/runtime/src/_server.tspackages/runtime/src/_services.tspackages/runtime/src/_standalone.tspackages/runtime/src/_validation.tspackages/runtime/src/agent.tspackages/runtime/src/app.tspackages/runtime/src/dev-patches/aisdk.tspackages/runtime/src/dev-patches/otel-llm.tspackages/runtime/src/devmode.tspackages/runtime/src/eval.tspackages/runtime/src/handlers/sse.tspackages/runtime/src/handlers/stream.tspackages/runtime/src/handlers/webrtc.tspackages/runtime/src/handlers/websocket.tspackages/runtime/src/index.tspackages/runtime/src/middleware.tspackages/runtime/src/otel/exporters/jsonl-metric-exporter.tspackages/runtime/src/router.tspackages/runtime/src/services/local/_router.tspackages/runtime/src/services/local/stream.tspackages/runtime/src/services/local/task.tspackages/runtime/src/services/session/json.tspackages/runtime/src/session.tspackages/runtime/src/validator.tspackages/runtime/src/web.tspackages/runtime/src/workbench.tspackages/runtime/test/base-app.test.tspackages/runtime/test/compression.test.tspackages/runtime/test/context-property-errors.test.tspackages/runtime/test/evals.test.tspackages/runtime/test/events.test.tspackages/runtime/test/helpers/mock-context.tspackages/runtime/test/helpers/mock-services.tspackages/runtime/test/helpers/test-context.tspackages/runtime/test/thread-id-header.test.tspackages/runtime/test/validator.test.tspackages/schema/src/base.tspackages/schema/src/coerce/date.tspackages/schema/src/complex/array.tspackages/schema/src/complex/object.tspackages/schema/src/complex/record.tspackages/schema/src/index.tspackages/schema/src/json-schema.tspackages/schema/src/primitives/any.tspackages/schema/src/primitives/string.tspackages/schema/src/utils/nullable.tspackages/schema/src/utils/optional.tspackages/schema/src/utils/union.tspackages/schema/test/json-schema.test.tspackages/server/src/logger.tspackages/server/src/schema.tspackages/server/src/server.tspackages/server/test/api.test.tspackages/server/test/sandbox-client.test.tspackages/test-utils/src/mock-fetch.tspackages/vscode/src/core/cliClient.tspackages/vscode/src/core/project.tspackages/vscode/src/core/sandboxManager.tspackages/vscode/src/features/agentExplorer/agentTreeData.tspackages/vscode/src/features/agentExplorer/index.tspackages/vscode/src/features/chat/agentTools.tspackages/vscode/src/features/chat/agentuityParticipant.tspackages/vscode/src/features/chat/contextProvider.tspackages/vscode/src/features/codeLens/index.tspackages/vscode/src/features/customAgents/index.tspackages/vscode/src/features/dataExplorer/dataTreeData.tspackages/vscode/src/features/dataExplorer/index.tspackages/vscode/src/features/devServer/devServerManager.tspackages/vscode/src/features/sandboxExplorer/index.tspackages/vscode/src/features/sandboxExplorer/sandboxTreeData.tspackages/workbench/test-app/vite.config.tsscripts/canary.tsscripts/publish.tsscripts/test-storage.tsscripts/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
- 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
|
Found 58 test failures on Blacksmith runners: Failures
|
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.
There was a problem hiding this comment.
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
📒 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/corepackage
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
UseStructuredErrorfrom@agentuity/corefor 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.
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
Summary
Rules enabled
noUnusedTemplateLiteraluseTemplateuseNodejsImportProtocolnode:prefixuseExponentiationOperatorMath.pow→**noUselessSwitchCasenoUselessUndefinedInitializationlet x = undefinednoUselessContinuenoControlCharactersInRegexFiles changed
Summary by CodeRabbit