Skip to content

Comments

Production update, docs update, and other fixes#2

Open
odilitime wants to merge 28 commits into1.xfrom
odi-dev
Open

Production update, docs update, and other fixes#2
odilitime wants to merge 28 commits into1.xfrom
odi-dev

Conversation

@odilitime
Copy link
Member

@odilitime odilitime commented Feb 10, 2026

Note

Low Risk
Only repository ignore patterns change; no runtime or build logic is modified.

Overview
Updates .gitignore to comprehensively exclude build outputs, dependency directories (including Yarn/PnP), env files (with explicit template/example allowlists), logs, coverage/test artifacts, IDE/editor configs, OS cruft, temp/debug directories, and other local/dev miscellany.

Written by Cursor Bugbot for commit e937662. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • New Features

    • Startup banner showing runtime mode and plugin settings
    • New providers: user stats and social feed
  • Documentation

    • Expanded README covering provider-driven reads, autonomous trading, identity/onboarding, and sentiment-based exits
  • Improvements

    • Stronger wallet/private-key validation, clearer wallet messages, graceful disable when wallet absent
    • Autonomous trading guard aligned with protocol-based service availability
  • Refactor

    • Centralized wallet validation utility
  • Chores

    • Expanded .gitignore rules
  • Tests

    • Wallet validation test suite added

odilitime and others added 5 commits February 10, 2026 01:40
- Enhanced .gitignore with comprehensive Node.js/TypeScript patterns
- Removed .pr-resolver-state.json from tracking
- Added banner.ts for plugin branding
- Added plugin-info.ts provider
- Added wallet-validation.ts utility with tests

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Updated documentation to reflect all new features:

## Features Section
- Added activity feed, daily login rewards, share/repost
- Mentioned autonomous trading pipeline and sentiment exits
- Added token efficiency (CSV format, ~60% savings)
- Added multi-resolution providers
- Added risk management features

## Providers Section
- Documented all multi-resolution providers (overview/medium/full)
- Listed dynamic providers (plugin_settings, plugin_usage, positions)
- Documented babylon_platform_info with BABYLON_ENABLE_INFO_PROVIDER setting
- Explained why multi-resolution (token optimization)

## Actions Section
- Added babylon_get_activity (activity feed)
- Added babylon_daily_login (streak + rewards)
- Added babylon_share_post (share/repost with quotes)

## Service Methods
- Updated counts (13 social methods, 15 user methods)
- Added new methods: unsharePost, getUserActivity, getPointsHistory, getDailyLogin, claimDailyLogin

## Pipeline Documentation
- Added sentiment-based exits explanation
- Updated flow diagram with sentiment updates
- Clarified NO-LLM monitoring for both price and sentiment

All new features from the autonomous trading refactor now documented.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings February 10, 2026 02:56
@greptile-apps
Copy link

greptile-apps bot commented Feb 10, 2026

Too many files changed for review. (114 files found, 100 file limit)

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 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

Centralizes private-key validation into a new utility, integrates it into EVM and client services, adds a startup banner, introduces dynamic social/user providers, adjusts autonomous trading guard and CRON_SECRET deprecation handling, expands docs and .gitignore, and adds tests and tsconfig exclusion for tests.

Changes

Cohort / File(s) Summary
Repo config
/.gitignore, package.json
Rewrote .gitignore into a comprehensive, sectioned ignore file; minor capitalization change in package.json description.
Documentation
README.md
Major docs revisions: provider model, write-only action framing, multi-resolution providers, sentiment exits, two‑phase autonomous flow, and configuration examples.
Wallet validation (new)
src/utils/wallet-validation.ts, src/__tests__/wallet-validation.test.ts
New validation module exposing result type, validatePrivateKey and validateAndNormalizePrivateKey, plus comprehensive unit tests covering empties, placeholders, formats, and normalization.
Services — validation integration
src/services/client.ts, src/services/evm.ts
Client and EVM now use the shared wallet validator; evm load wallet config can return null; EVM init gracefully disables features if wallet config absent/invalid; consolidated registration cache field.
Plugin init & banner
src/banner.ts, src/plugin.ts
Added printBanner() and invoke it at plugin startup; reordered init logs; reduced CORE_ACTIONS to write-focused actions and documented provider mapping for reads.
Providers
src/providers/plugin-info.ts, src/providers/registration-status.ts, src/providers/social-feed.ts, src/providers/user-stats.ts
Added dynamic social and user stats providers; set registrationStatusProvider.dynamic = true; plugin-info.ts added (empty).
Autonomy & environment
src/autonomous/AutonomousCoordinator.ts, src/autonomous/config.ts, src/environment.ts, src/types.ts
Trading guard now checks protocol flag + backendService; simplified CRON_SECRET deprecation handling and removed exported warnIfCronSecretUsed.
A2A / MCP handling
src/services/a2a.ts
Refined MCP JSON-RPC error extraction to prefer content/raw result and removed duplicate tool-name mappings.
Test config
tsconfig.json
Broadened exclude pattern to **/__tests__/** to align test locations.
Refactor doc
REFACTORING_SUMMARY.md
Documented extraction of wallet validation utility and integration points.
Miscellaneous
src/banner.ts, src/types.ts, small edits across src/*
Added banner types/exports; removed cron-secret helper export; minor comment/capitalization tweaks.

Sequence Diagram(s)

sequenceDiagram
    participant Plugin as Plugin init
    participant Banner as Banner printer
    participant EVM as EVMService
    participant Client as ClientService
    participant Validator as WalletValidator

    Plugin->>Banner: printBanner(options)
    Banner-->>Plugin: banner logged
    Plugin->>EVM: initialize()
    EVM->>Validator: validatePrivateKey(config.privateKey)
    Validator-->>EVM: ValidationResult
    alt valid key
        EVM->>EVM: load wallet, derive address, enable features
    else invalid or missing
        EVM->>Plugin: log warning, disable EVM features
    end
    Plugin->>Client: initializeWallet()
    Client->>Validator: validatePrivateKey(privateKey?)
    Validator-->>Client: ValidationResult
    alt valid
        Client->>Client: construct wallet
    else invalid
        Client-->>Plugin: set wallet null
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐇 I nudge the keys and tidy the lair,

I print our name with jaunty flair,
I check the wallets, quiet and spry,
I fetch the feeds that scroll on by,
A hop, a fix — the code grows fair.

🚥 Pre-merge checks | ✅ 2 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Production update, docs update, and other fixes' is vague and overly broad, using generic terms that do not clearly convey the main changes; it covers multiple unrelated aspects without specifying the primary focus of the changeset. Revise the title to be more specific and descriptive of the primary change, such as 'Refactor providers for clarity and expand configuration' or 'Add wallet validation utility and update plugin initialization flow'.
✅ Passed checks (2 passed)
Check name Status Explanation
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into 1.x
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch odi-dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@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: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/environment.ts (1)

46-50: ⚠️ Potential issue | 🟡 Minor

Duplicate deprecation warning for CRON_SECRET.

When CRON_SECRET is set, lines 48–49 emit an inline deprecation warning, and then line 68 calls warnIfCronSecretUsed(this.config, ...) which likely emits another. This results in redundant log noise on every loadFromRuntime call. Pick one approach — either the inline warning or the helper — not both.

♻️ Option: Remove the inline warning and keep the helper
     // Warn if deprecated cronSecret is used
     const cronSecret = runtime.getSetting('CRON_SECRET');
-    if (cronSecret) {
-      runtime.logger.warn('DEPRECATED: CRON_SECRET is deprecated and will be removed in a future version. Please use BABYLON_API_KEY instead.');
-    }

     this.config = {

Also applies to: 68-68

README.md (1)

67-69: ⚠️ Potential issue | 🟠 Major

CRON_SECRET is documented as primary config but is deprecated in code.

src/types.ts actively warns that cronSecret is deprecated in favor of apiKey / BABYLON_API_KEY. Yet the README (Lines 69, 101, 109–118) instructs users to generate and configure CRON_SECRET without mentioning the deprecation or the replacement. This will lead new users to adopt an already-deprecated configuration path.

Consider updating the setup instructions to use BABYLON_API_KEY and adding a deprecation note for CRON_SECRET.

🤖 Fix all issues with AI agents
In `@README.md`:
- Line 51: The README contains inconsistent counts for A2A methods: the
"Agent-to-Agent Protocol" entry uses the string "80+ methods" while other
occurrences use "73+ methods"; locate the header titled "Agent-to-Agent
Protocol" and the two other occurrences of the method-count string ("73+
methods"/"80+ methods") and make them consistent by verifying the correct number
and updating the differing instance(s) so all three references use the same
accurate count (replace the "80+ methods" text or the "73+ methods" text
accordingly).
- Around line 1123-1131: The fenced code block in the README (the multi-line
diagram starting with "Posts → Phase 1...") lacks a language specifier which
triggers markdownlint MD040; update that fenced block by adding a language token
(for example "text") after the opening backticks so the block becomes a fenced
code block with a language (e.g., change the opening "```" to "```text") to
satisfy the linter and improve rendering.

In `@REFACTORING_SUMMARY.md`:
- Around line 56-62: The fenced code block listing validation checklist lacks a
language specifier which violates markdownlint MD040; update the backtick fence
for that block (the triple-quoted block containing "✓ Valid keys..." through "✓
Convenience wrapper function") to include a language token such as "text" (e.g.,
change ``` to ```text) so the block is explicitly tagged and the linter warning
is resolved.

In `@src/banner.ts`:
- Around line 69-74: The line() function currently slices the raw string (with
ANSI codes) which can cut inside escape sequences; update line() to build the
output by iterating tokens that are either ANSI escape sequences or single
visible characters (e.g. using a regex like /(\x1b\[[0-9;]*m)|./g), appending
whole escape tokens without counting toward visible length and appending visible
character tokens while counting until visible length == 78, then stop; after
building the truncated/preserved string, pad with spaces to reach 78 visible
characters using the stripped length, and return that result—modify the existing
line function to implement this tokenized iteration and preserve ANSI sequences.

In `@src/plugin.ts`:
- Line 3: The import in plugin.ts uses a `.ts` extension ("import { printBanner
} from './banner.ts'") which is inconsistent with the project's convention;
update that import to remove the extension so it reads "import { printBanner }
from './banner'" to match other imports like './constants' and './routes' and
ensure consistency across the codebase.

In `@src/providers/plugin-info.ts`:
- Around line 13-33: The plugin info string assigned to the variable
instructions currently describes Babylon.js 3D rendering and must be replaced
with text describing the Babylon prediction-markets plugin: update the
instructions variable content to explain plugin capabilities around prediction
markets, perpetual futures, social trading features, market data feeds, order
placement, risk controls, and the A2A protocol for agent-to-agent interactions
(include best practices like data freshness, margin considerations, and
privacy/consent for social features); ensure language and headings mirror the
project's README/banner terminology (e.g., "prediction markets", "perpetual
futures", "social trading", "A2A protocol") so the LLM receives accurate
context.

In `@src/providers/social-feed.ts`:
- Around line 29-37: When handling the result of service.getFeed() in the
social-feed provider, guard against feed.posts being undefined/null before
accessing .length: obtain a safe posts array (e.g., via optional chaining or
nullish coalescing) from feed.posts (e.g., const posts = feed.posts ?? []), then
check posts.length and use posts in the returned data instead of feed.posts;
update references in this block (service.getFeed, feed.posts) to use the safe
posts variable.
- Around line 44-47: The CSV row construction prepends "@" outside csvEscape
which breaks quoting when authorUsername contains commas/quotes; update the code
that builds rows (the loop that pushes into rows, referencing feed.posts.slice
and the csvEscape utility) to include the "@" inside the value passed to
csvEscape (i.e., call csvEscape with `@${post.authorUsername}`) so the entire
`@username` is properly quoted/escaped before concatenating the other CSV columns.

In `@src/services/evm.ts`:
- Around line 200-209: The current logging in the validatePrivateKey failure
path exposes up to 20 characters of the invalid privateKey; update the
runtime.logger.warn call inside the validatePrivateKey handling to truncate the
privateKey to the same 6-character prefix pattern used elsewhere (e.g., line
118) instead of 20 characters, keeping keySource, validationResult.error and
validationResult.message intact; locate the block around validatePrivateKey,
validationResult, and the runtime.logger.warn call and change the invalidValue
to only include the first 6 characters (with an ellipsis) or 'undefined' when
absent.
🧹 Nitpick comments (8)
src/providers/user-stats.ts (1)

38-44: Errors are silently swallowed — consider logging.

The catch block returns a generic message but doesn't log the error. Compare with registrationStatusProvider (line 51 of registration-status.ts) which logs via runtime.logger.error. Silent failures here will make debugging service issues difficult.

♻️ Suggested fix
     } catch (error) {
+      runtime.logger.error(`Error in babylon_user_stats provider: ${error instanceof Error ? error.message : String(error)}`);
       return {
         text: 'Unable to fetch user stats at this time.',
         data: {},
         values: {},
       };
     }
src/providers/social-feed.ts (1)

57-63: Error is silently swallowed—consider logging for debuggability.

The catch block returns a generic message but doesn't log the underlying error. This will make production debugging difficult.

Proposed fix
     } catch (error) {
+      runtime.logger?.error?.('Failed to fetch social feed:', error);
       return {
         text: 'Unable to fetch social feed at this time.',
         data: {},
         values: {},
       };
     }

Note: runtime is available in the closure scope. If runtime.logger isn't guaranteed here, a conditional check suffices.

src/providers/plugin-info.ts (1)

42-54: Settings provider is hardcoded despite being dynamic: true.

This provider always returns pluginEnabled: true and 3D Rendering: Available regardless of actual runtime state. Since runtime is available, consider reflecting real configuration (e.g., autonomous mode, backend type, registration status). At minimum, the "3D Rendering" reference is incorrect for this plugin.

src/banner.ts (2)

76-80: Unused variable W (brightWhite).

W is declared on Line 80 but never referenced in the function body.

Proposed fix
   const R = ANSI.reset, D = ANSI.dim, B = ANSI.bold;
   const c1 = ANSI.bronze, c2 = ANSI.gold, c3 = ANSI.sand;
-  const W = ANSI.brightWhite;

76-84: Inconsistent indentation inside printBanner.

The function body mixes 4-space indentation (Lines 77, 82–84) with 2-space indentation (Lines 78–80). Pick one consistently.

src/services/client.ts (1)

16-21: Validation failure is silent—validationResult.message is discarded.

When a private key fails validation (placeholder, invalid format), the method silently sets wallet = null with no logging. The validation result includes a descriptive message (e.g., "Detected placeholder private key value") that would be valuable for debugging. Without it, users with misconfigured keys will have no indication of what went wrong.

Consider logging the validation message, or at minimum the error type:

Proposed fix
     const validationResult = validatePrivateKey(privateKey);
     if (!validationResult.isValid) {
+      console.warn(`Wallet initialization skipped: ${validationResult.message}`);
       this.wallet = null;
       return;
     }

If a logger instance is available (or can be passed in), prefer that over console.warn.

src/utils/wallet-validation.ts (2)

74-77: Function name validateAndNormalizePrivateKey is misleading — no normalization occurs.

The function validates and returns the key as-is or null. It doesn't trim whitespace, add/remove the 0x prefix, or perform any actual normalization. Consider renaming to validatePrivateKeyOrNull or similar, or actually implementing normalization (e.g., trimming, ensuring consistent 0x prefix).


22-65: Consider trimming the input before hex validation.

The empty check trims to detect whitespace-only strings (line 24), but the actual key is validated untrimmed against the hex regex. A key like " 0xabc...def" with a leading space would fail format validation rather than being handled gracefully. If callers might pass keys from config files where accidental whitespace is common, trimming early would be more robust.

Suggested change
 export function validatePrivateKey(privateKey: string | undefined | null): PrivateKeyValidationResult {
     // Check for empty/null/undefined
     if (!privateKey || privateKey.trim() === '') {
         return {
             isValid: false,
             error: 'EMPTY',
             message: 'No private key configured',
         };
     }
 
+    // Trim whitespace for subsequent checks
+    const trimmedKey = privateKey.trim();
+
     // Check for common placeholder values
-    const upperKey = privateKey.toUpperCase();
+    const upperKey = trimmedKey.toUpperCase();
     if (placeholderPatterns.some(pattern => upperKey.includes(pattern))) {

And use trimmedKey for the hex pattern test as well.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors and centralizes EVM private-key validation, adjusts EVM service initialization to gracefully disable blockchain features when no wallet is configured, and updates documentation/configuration-related output (banner + README), alongside adding a few new providers and removing committed dist/ declaration artifacts.

Changes:

  • Add validatePrivateKey utilities with Bun tests, and reuse them in EVM/client wallet initialization.
  • Make BabylonEvmService wallet config optional (warn + disable EVM features instead of throwing) and improve some error formatting.
  • Add a runtime settings banner + expand README/docs; add new providers and mark registration status provider as dynamic; remove committed dist/**/*.d.ts artifacts and expand .gitignore.

Reviewed changes

Copilot reviewed 18 out of 114 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/utils/wallet-validation.ts New shared private key validation helpers.
src/utils/tests/wallet-validation.test.ts New Bun unit tests for the validator.
src/services/evm.ts Refactors wallet loading/validation and makes EVM initialization optional when wallet is missing/invalid.
src/services/client.ts Adds private-key validation before creating an ethers Wallet.
src/services/a2a.ts Improves MCP tool error stringification and removes duplicated tool-name mappings.
src/types.ts Removes old cronSecret warning helper and adjusts globalThis typing cast for warn-once behavior.
src/environment.ts Removes duplicate cronSecret warning logic; keeps centralized warning call.
src/plugin.ts Adds initialization banner printing and adjusts init logging order.
src/banner.ts New banner renderer for showing key settings (with masking support).
src/providers/user-stats.ts New dynamic provider for user stats via users service.
src/providers/social-feed.ts New dynamic provider producing token-efficient CSV social feed output.
src/providers/registration-status.ts Marks provider as dynamic: true.
src/providers/plugin-info.ts Adds new “instructions/settings” providers (currently not wired into provider registry).
src/autonomous/config.ts Minor comment casing change (“elizaOS”).
src/autonomous/AutonomousCoordinator.ts Variable naming cleanup for backend/protocol service selection.
package.json Updates description casing; still points main/types at dist/*.
README.md Significant docs expansion (providers, tasks, pipeline, actions list).
REFACTORING_SUMMARY.md New doc explaining the private key validation refactor.
.gitignore Expanded ignore patterns; now ignores dist/.
dist/** Removes many committed declaration artifacts (*.d.ts).
Comments suppressed due to low confidence (1)

package.json:8

  • main/types point to dist/*, and .gitignore now ignores dist/ while the PR removes committed dist artifacts. If the package is expected to be consumable when installed from a git URL or used without a prior build step, add a prepare/postinstall build (or keep dist checked in) to avoid runtime/type resolution failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 203 to 207
this.runtime.logger.warn({
keySource,
error: validationResult.error,
invalidValue: privateKey ? privateKey.substring(0, 20) + '...' : 'undefined',
}, `⚠️ ${validationResult.message}`);
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Avoid logging any portion of a private key. invalidValue: privateKey.substring(0, 20) + '...' still leaks sensitive material into logs; log only the key source and validation error, or use a fully masked placeholder (e.g., fixed-length bullets) instead.

Copilot uses AI. Check for mistakes.
Comment on lines 74 to 76
export function validateAndNormalizePrivateKey(privateKey: string | undefined | null): string | null {
const result = validatePrivateKey(privateKey);
return result.isValid ? privateKey! : null;
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

validateAndNormalizePrivateKey doesn’t currently normalize anything (it returns the original string). Either rename it to reflect its behavior (e.g., validatePrivateKeyOrNull) or actually normalize (e.g., trim + ensure 0x prefix) so the name matches the returned value.

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 3
import { describe, expect, it } from 'bun:test';
import { validatePrivateKey, validateAndNormalizePrivateKey } from '../wallet-validation';

Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

This test file lives under src/utils/__tests__, but tsconfig.json only excludes src/__tests__/**. If any type-check/declaration build uses tsconfig includes, these tests may be picked up (and can break builds due to bun:test types). Consider moving tests under src/__tests__ (consistent with existing tests) or updating tsconfig exclude to **/__tests__/**.

Copilot uses AI. Check for mistakes.
Comment on lines 13 to 33
const instructions = `
# Babylon Plugin Capabilities

## What This Plugin Does

The Babylon plugin integrates Babylon.js 3D rendering capabilities for immersive experiences.

## Features

- **3D Rendering**: Display 3D content and scenes
- **Avatar System**: Render agent avatars
- **Environment Creation**: Build virtual spaces
- **Interaction Handling**: Process 3D interactions

## Best Practices

1. **Performance**: Optimize 3D assets for smooth rendering
2. **Accessibility**: Provide alternatives for 3D content
3. **Progressive Loading**: Load 3D content efficiently
4. **Fallback Options**: Handle non-3D capable clients
`;
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The provider text describes a “Babylon 3D plugin” and Babylon.js rendering, which doesn’t match this repository’s Babylon prediction market plugin. If this provider is intended to be user-facing, the content should be updated to the correct domain; otherwise it should be removed to avoid accidental exposure of incorrect instructions.

Copilot uses AI. Check for mistakes.
Comment on lines 7 to 54
export const babylonInstructionsProvider: Provider = {
name: 'babylonInstructions',
description: 'Instructions for the Babylon 3D plugin',
dynamic: true,

get: async (runtime: IAgentRuntime, _message: Memory, _state: State): Promise<ProviderResult> => {
const instructions = `
# Babylon Plugin Capabilities

## What This Plugin Does

The Babylon plugin integrates Babylon.js 3D rendering capabilities for immersive experiences.

## Features

- **3D Rendering**: Display 3D content and scenes
- **Avatar System**: Render agent avatars
- **Environment Creation**: Build virtual spaces
- **Interaction Handling**: Process 3D interactions

## Best Practices

1. **Performance**: Optimize 3D assets for smooth rendering
2. **Accessibility**: Provide alternatives for 3D content
3. **Progressive Loading**: Load 3D content efficiently
4. **Fallback Options**: Handle non-3D capable clients
`;

return {
text: instructions.trim(),
data: { pluginName: 'babylon' },
};
},
};

export const babylonSettingsProvider: Provider = {
name: 'babylonSettings',
description: 'Current Babylon configuration',
dynamic: true,

get: async (runtime: IAgentRuntime, _message: Memory, _state: State): Promise<ProviderResult> => {
return {
text: `# Babylon Plugin Settings\n\n- **Status**: Enabled\n- **3D Rendering**: Available`,
data: { pluginEnabled: true },
values: { pluginEnabled: 'true' },
};
},
};
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

plugin-info.ts introduces new providers (babylonInstructions, babylonSettings) but they aren’t exported/registered in src/providers/index.ts, so this code appears unused. Either wire these providers into the provider registry (and align naming with existing babylon_* provider names) or drop the file to avoid dead code.

Copilot uses AI. Check for mistakes.
Comment on lines 46 to 56

- **Prediction Markets**: Buy/sell YES/NO shares, get market data, list active markets
- **Perpetual Futures**: Open/close positions with leverage, get funding rates, manage positions
- **User Management**: Get profile, update settings, check balance and portfolio
- **Social Features**: Create posts, reply to posts, get social feed, join groups
- **Agent-to-Agent Protocol**: Real-time communication using official `@a2a-js/sdk` (73+ methods)
- **User Management**: Get profile, activity feed, daily login rewards, check balance and portfolio
- **Social Features**: Create posts, reply to posts, share/repost, get social feed, join groups
- **Agent-to-Agent Protocol**: Real-time communication using MCP + A2A protocols (80+ methods)
- **Wallet & Identity**: Embedded wallet creation and on-chain registration for autonomous agents
- **Autonomous Mode**: Agents can play as themselves with configurable permissions
- **Rich Providers**: Context providers for market intelligence, portfolio, social feed, and user stats
- **Autonomous Trading**: Two-phase batch processing with sentiment-based position exits (NO LLM for monitoring)
- **Token Efficient**: CSV format prompts (~60% token savings), smart deduplication, batched LLM calls
- **Multi-Resolution Providers**: Dynamic providers at 3 levels (overview/medium/full) for optimal context
- **Risk Management**: Position limits, exposure checks, stop-loss/take-profit, sentiment-based exits
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The PR title is “Docs update”, but this change set includes runtime behavior changes (new private-key validation + EVM initialization now optional), new providers, and build artifact removals. Please update the PR title/description to reflect the scope so reviewers know this is not docs-only.

Copilot uses AI. Check for mistakes.
src/banner.ts Outdated
const { settings, runtime, mode } = options;
const R = ANSI.reset, D = ANSI.dim, B = ANSI.bold;
const c1 = ANSI.bronze, c2 = ANSI.gold, c3 = ANSI.sand;
const W = ANSI.brightWhite;
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Unused variable W.

Copilot uses AI. Check for mistakes.
…tead)

Removed 8 read-only actions that duplicate provider functionality:

## Removed Actions
- babylon_get_market_data → Use babylon_markets_full provider
- babylon_list_markets → Use babylon_markets provider
- babylon_get_positions → Use babylon_positions provider
- babylon_get_funding_rates → Use babylon_perpetuals_full provider
- babylon_get_profile → Use babylon_profile provider
- babylon_get_balance → Use babylon_portfolio provider
- babylon_get_activity → Use providers or create activity provider
- babylon_get_feed → Use babylon_feed provider

## Why Remove
- Providers are more efficient (batched, cached, multi-resolution)
- LLM can choose resolution level (overview/medium/full)
- CSV format saves ~60% tokens
- Actions should be for WRITE operations only
- Reduces LLM confusion (fewer options to choose from)

## Remaining Actions (11 total)
- Trading: buy/sell shares, open/close positions
- User: update settings, daily login (claim)
- Social: create/reply/share posts, join groups
- A2A: send messages
- Identity: register agent, test auth, get faucet

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

423-435: ⚠️ Potential issue | 🟡 Minor

Moderation section header says "9 methods" but lists 10.

The code block contains 10 method calls (blockUser, unblockUser, muteUser, unmuteUser, reportUser, reportPost, getBlocks, getMutes, checkBlockStatus, checkMuteStatus).

-#### Moderation (9 methods)
+#### Moderation (10 methods)
🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 261-272: Insert a blank line immediately before the "**Mapping:**"
heading/table block in README.md to satisfy markdownlint MD058; locate the
section that starts with the bold "**Mapping:**" line (the table with header row
"| Old Action | Use Provider Instead |") and ensure there is an empty line above
it so the table is separated from the preceding paragraph.
🧹 Nitpick comments (2)
src/plugin.ts (2)

94-131: capabilities || {} on line 121 is unreachable — lines 108-112 already guarantee a non-falsy value.

After the if/else if chain (lines 108-112), capabilities is always a truthy object (either the default { trading: true, ... }, the parsed result, or {}). The || {} fallback on line 121 is dead code.

Proposed simplification
       const result = await babylonEvmService.identity.registerAgent({
         name,
         a2aEndpoint,
-        capabilities: capabilities || {},
+        capabilities,
         metadataCID: params.metadataCID,
       });

369-422: RPC call in registerWithPlugin8004 has no timeout and blocks on network I/O.

Line 380 creates a JsonRpcProvider and immediately calls getNetwork(). If the RPC endpoint is slow or unresponsive, this will hang indefinitely since there's no timeout configured. Given this is called during plugin init (albeit fire-and-forget from the caller's perspective via the try/catch), a stuck RPC call would leave this async function dangling.

Consider adding a timeout or passing provider options:

Proposed fix
-    const chainId = Number((await new ethers.JsonRpcProvider(rpcUrl).getNetwork()).chainId);
+    const provider = new ethers.JsonRpcProvider(rpcUrl);
+    const network = await Promise.race([
+      provider.getNetwork(),
+      new Promise<never>((_, reject) =>
+        setTimeout(() => reject(new Error('RPC getNetwork timeout')), 10_000)
+      ),
+    ]);
+    const chainId = Number(network.chainId);

@odilitime odilitime changed the title Docs update Production update, docs update, and other fixes Feb 10, 2026
Iteration 1

prr-fix:prrc_kwdoqz480c6mcbn7
prr-fix:prrc_kwdoqz480c6mcbof
prr-fix:prrc_kwdoqz480c6mcbok
prr-fix:prrc_kwdoqz480c6mcbon
prr-fix:prrc_kwdoqz480c6mcbos
prr-fix:prrc_kwdoqz480c6mcckx
prr-fix:prrc_kwdoqz480c6mcbox
prr-fix:prrc_kwdoqz480c6mcbow
prr-fix:prrc_kwdoqz480c6mcboz
prr-fix:prrc_kwdoqz480c6mccj9
prr-fix:prrc_kwdoqz480c6mcckj
prr-fix:prrc_kwdoqz480c6mcckp
prr-fix:prrc_kwdoqz480c6mcd27
Copy link

@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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/services/evm.ts (1)

435-441: ⚠️ Potential issue | 🟡 Minor

Null-safety gap in deprecated checkAgentRegistrationStatus.

Line 439 calls agentInfo.reputation.toString() without a null check, while the equivalent code in refreshRegistrationCache (line 349) properly guards with agentInfo.reputation != null. If reputation is ever null/undefined, this will throw. Since the method is deprecated, this is low priority, but worth aligning for safety.

Suggested fix
-            reputation: agentInfo.reputation.toString(),
+            reputation: agentInfo.reputation != null ? agentInfo.reputation.toString() : '0',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/services/evm.ts` around lines 435 - 441, checkAgentRegistrationStatus
builds an object using agentInfo.reputation.toString() without guarding against
null/undefined; update the mapping in checkAgentRegistrationStatus to mirror
refreshRegistrationCache by checking agentInfo.reputation != null before calling
toString() (e.g., set reputation to agentInfo.reputation != null ?
agentInfo.reputation.toString() : null) so it won't throw when reputation is
null or undefined.
🧹 Nitpick comments (1)
src/banner.ts (1)

93-96: Inconsistent indentation in printBanner.

Lines 95–96 use 2-space indentation while the rest of the function body uses 4-space. Minor style nit.

 export function printBanner(options: BannerOptions): void {
     const { settings, runtime, mode } = options;
-  const R = ANSI.reset, D = ANSI.dim, B = ANSI.bold;
-  const c1 = ANSI.bronze, c2 = ANSI.gold, c3 = ANSI.sand;
+    const R = ANSI.reset, D = ANSI.dim, B = ANSI.bold;
+    const c1 = ANSI.bronze, c2 = ANSI.gold, c3 = ANSI.sand;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/banner.ts` around lines 93 - 96, The function printBanner has
inconsistent indentation (lines where const R = ANSI.reset, D = ANSI.dim, B =
ANSI.bold; and const c1/c2/c3 are indented 2 spaces while the rest uses 4); fix
by aligning these declarations to the same 4-space indentation as the
surrounding function body. Edit the printBanner function to use consistent
4-space indentation for the destructuring line and the subsequent const
declarations (R, D, B, c1, c2, c3) so the function body is uniformly indented.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 1124-1132: The fenced code block containing the diagram starting
with "Posts → Phase 1 (Routing + Actions) → Execute LIKEs → Sentiment Updates
(NO LLM)" is missing a language specifier; update the opening fence from ``` to
```text (keeping the existing closing ```), so the block becomes a ```text
fenced code block to satisfy markdownlint MD040 and improve rendering.

In `@src/providers/social-feed.ts`:
- Around line 44-46: The code is calling post.content.substring(0, 60) without
guarding for null/undefined; update the logic in the loop that builds rows (the
for (const post of feed.posts.slice(0, 5)) block) to safely derive
contentPreview by using a fallback when post.content is null/undefined (e.g.,
coalesce to an empty string or call String(post.content)) before taking the
first 60 chars and replacing newlines, then continue to use csvEscape and
rows.push as before so no NPE occurs.

---

Outside diff comments:
In `@src/services/evm.ts`:
- Around line 435-441: checkAgentRegistrationStatus builds an object using
agentInfo.reputation.toString() without guarding against null/undefined; update
the mapping in checkAgentRegistrationStatus to mirror refreshRegistrationCache
by checking agentInfo.reputation != null before calling toString() (e.g., set
reputation to agentInfo.reputation != null ? agentInfo.reputation.toString() :
null) so it won't throw when reputation is null or undefined.

---

Duplicate comments:
In `@README.md`:
- Around line 261-262: Add a blank line before the markdown table that follows
the "**Mapping:**" heading to satisfy markdownlint MD058; locate the
"**Mapping:**" header and insert an empty newline immediately before the table
start ("| Old Action | Use Provider Instead |") so the table is separated from
the preceding paragraph.
- Line 308: The README contains inconsistent counts for A2A methods ("80+" near
the BabylonA2AService mention and "73+" elsewhere); update the text so both
mentions use the same, accurate number of methods (pick the correct canonical
count) by editing the line that references BabylonA2AService and the other
earlier mention to the agreed value and ensure any surrounding phrasing remains
grammatically correct.
- Around line 1156-1164: The fenced code block containing the ASCII flow diagram
beginning with "Posts → Phase 1 (Routing + Actions) → Execute LIKEs → Sentiment
Updates (NO LLM)" is missing a language specifier and triggers markdownlint
MD040; update that code fence to include a language such as "text" (e.g., change
``` to ```text) so the block is properly recognized by linters and renderers.

In `@src/providers/social-feed.ts`:
- Around line 29-37: Guard against feed.posts being undefined by capturing posts
with a safe default and using that variable throughout: after calling
service.getFeed() (function getFeed and variable feed), assign const posts =
feed.posts ?? []; then change the conditional to check posts.length and replace
all subsequent references to feed.posts with posts so code never calls .length
on undefined.

---

Nitpick comments:
In `@src/banner.ts`:
- Around line 93-96: The function printBanner has inconsistent indentation
(lines where const R = ANSI.reset, D = ANSI.dim, B = ANSI.bold; and const
c1/c2/c3 are indented 2 spaces while the rest uses 4); fix by aligning these
declarations to the same 4-space indentation as the surrounding function body.
Edit the printBanner function to use consistent 4-space indentation for the
destructuring line and the subsequent const declarations (R, D, B, c1, c2, c3)
so the function body is uniformly indented.

Changes:
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Inconsistent A2A method count: "80+" her...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- REFACTORING_SUMMARY.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add a language specifier to the fenced c...
- banner.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`line()` truncation slices raw string (w...
- plugin.ts: _⚠️ Potential issue_ | _🟡 Minor_

<details>
<summary>🧩 Analysis chain</summ...
- plugin-info.ts: _⚠️ Potential issue_ | _🟠 Major_

**Instructions describe wrong plugin — "Ba...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Potential NPE if `feed.posts` is undefin...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**CSV row: `@` prefix sits outside the `cs...
- evm.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Logging up to 20 characters of the key v...
- evm.ts: Avoid logging any portion of a private key. `invalidValue: privateKey.substri...
- wallet-validation.ts: `validateAndNormalizePrivateKey` doesn’t currently normalize anything (it ret...
- plugin-info.ts: The provider text describes a “Babylon 3D plugin” and Babylon.js rendering, w...
- plugin-info.ts: `plugin-info.ts` introduces new providers (`babylonInstructions`, `babylonSet...
- banner.ts: Unused variable W.
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add blank line before the table to fix m...
Iteration 2

prr-fix:prrc_kwdoqz480c6mccj9
prr-fix:prrc_kwdoqz480c6mcbn7
prr-fix:prrc_kwdoqz480c6nw-2o
Iteration 3

prr-fix:prrc_kwdoqz480c6mcbof
prr-fix:prrc_kwdoqz480c6mcbox
prr-fix:prrc_kwdoqz480c6nw-2r
prr-fix:prrc_kwdoqz480c6mcckr
Copy link

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/services/evm.ts (1)

164-209: ⚠️ Potential issue | 🟡 Minor

Minor: keySource is misleading when neither key is configured.

If BABYLON_GAME_PRIVATE_KEY is unset (entering the fallback branch at line 171) and EVM_PRIVATE_KEY is also unset, keySource remains 'BABYLON_GAME_PRIVATE_KEY' (line 168) because the reassignment on line 186 is guarded by if (fallbackKey). The warning log at line 203–207 will then attribute the failure to BABYLON_GAME_PRIVATE_KEY even though the code actually tried the EVM fallback path.

Not a functional bug (the agent still degrades gracefully), but it could confuse operators debugging missing-wallet issues.

Proposed fix
       privateKey = fallbackKey || '';
       if (fallbackKey) {
         keySource = 'EVM_PRIVATE_KEY (fallback)';
         this.runtime.logger.info('✅ Using plugin-evm wallet settings as fallback');
+      } else {
+        keySource = 'none (checked BABYLON_GAME_PRIVATE_KEY and EVM_PRIVATE_KEY)';
       }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/services/evm.ts` around lines 164 - 209, The keySource tracking in
loadWalletConfig is left as 'BABYLON_GAME_PRIVATE_KEY' when the code falls into
the fallback branch, causing misleading logs; update loadWalletConfig so that
when entering the `if (!privateKey)` fallback branch you immediately set
`keySource` to reflect the fallback attempt (e.g., set to 'EVM_PRIVATE_KEY
(fallback)' when `fallbackKey` exists, or to 'none'/'unset' when `fallbackKey`
is absent), and only override it later if you detect a concrete source; adjust
the warning/logging that uses `keySource` so it reports the accurate origin (use
the existing `fallbackKey`, `EVM_PRIVATE_KEY`, and `BABYLON_GAME_PRIVATE_KEY`
symbols to determine the correct label).
🧹 Nitpick comments (1)
src/providers/plugin-info.ts (1)

1-12: Consider deleting this file instead of keeping an empty placeholder.

An empty file with only a comment adds clutter. If the providers are needed later, they can be recreated; the git history preserves the old content. That said, this is a minor preference — keeping the comment as a breadcrumb is reasonable too.

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

In `@src/providers/plugin-info.ts` around lines 1 - 12, Remove the empty
placeholder module plugin-info.ts from the repository to avoid dead code
clutter; if you truly want to keep a breadcrumb instead, convert the comment
into a concise TODO and ensure any future providers (e.g., babylon_instructions,
babylon_settings) are named to the babylon_* convention and will be exported and
registered in providers/index.ts and added to the plugin’s provider list before
re-adding the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 302-305: The "Mapping:" section contains an unfinished table with
only the header row "| Old Action | Use Provider Instead |"; either remove this
duplicate/truncated table or complete it by adding the required separator row
and the same data rows used in the earlier mapping table (copy the rows from the
existing mapping block), so update the README's "Mapping:" block that contains
the header "| Old Action | Use Provider Instead |" to be either deleted or
completed to match the full table.

---

Outside diff comments:
In `@src/services/evm.ts`:
- Around line 164-209: The keySource tracking in loadWalletConfig is left as
'BABYLON_GAME_PRIVATE_KEY' when the code falls into the fallback branch, causing
misleading logs; update loadWalletConfig so that when entering the `if
(!privateKey)` fallback branch you immediately set `keySource` to reflect the
fallback attempt (e.g., set to 'EVM_PRIVATE_KEY (fallback)' when `fallbackKey`
exists, or to 'none'/'unset' when `fallbackKey` is absent), and only override it
later if you detect a concrete source; adjust the warning/logging that uses
`keySource` so it reports the accurate origin (use the existing `fallbackKey`,
`EVM_PRIVATE_KEY`, and `BABYLON_GAME_PRIVATE_KEY` symbols to determine the
correct label).

---

Duplicate comments:
In `@README.md`:
- Around line 261-262: Add a blank line before the Markdown table that follows
the "**Mapping:**" heading to satisfy markdownlint MD058; locate the
"**Mapping:**" line and ensure there is an empty line between that heading and
the table start ("| Old Action | Use Provider Instead |") so the table is
properly separated from the preceding paragraph.
- Line 308: The README has inconsistent A2A method counts: one occurrence says
"80+ methods" while others say "73+ methods"; locate the references to
BabylonA2AService and the three other occurrences that mention "73+" and make
them consistent—either update all to the correct current count (e.g., change the
"80+ methods" instance to "73+ methods" or vice versa) or replace the hard
number with a stable phrase like "70+ methods" or "dozens of methods" to avoid
future drift; ensure the wording near BabylonA2AService is adjusted consistently
across the README.

---

Nitpick comments:
In `@src/providers/plugin-info.ts`:
- Around line 1-12: Remove the empty placeholder module plugin-info.ts from the
repository to avoid dead code clutter; if you truly want to keep a breadcrumb
instead, convert the comment into a concise TODO and ensure any future providers
(e.g., babylon_instructions, babylon_settings) are named to the babylon_*
convention and will be exported and registered in providers/index.ts and added
to the plugin’s provider list before re-adding the file.

Iteration 4

prr-fix:prrc_kwdoqz480c6mcckp
Changes:
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Inconsistent A2A method count: "80+" her...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- REFACTORING_SUMMARY.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add a language specifier to the fenced c...
- banner.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`line()` truncation slices raw string (w...
- plugin.ts: _⚠️ Potential issue_ | _🟡 Minor_

<details>
<summary>🧩 Analysis chain</summ...
- plugin-info.ts: _⚠️ Potential issue_ | _🟠 Major_

**Instructions describe wrong plugin — "Ba...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Potential NPE if `feed.posts` is undefin...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**CSV row: `@` prefix sits outside the `cs...
- evm.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Logging up to 20 characters of the key v...
- evm.ts: Avoid logging any portion of a private key. `invalidValue: privateKey.substri...
- wallet-validation.ts: `validateAndNormalizePrivateKey` doesn’t currently normalize anything (it ret...
- wallet-validation.test.ts: This test file lives under `src/utils/__tests__`, but `tsconfig.json` only ex...
- plugin-info.ts: The provider text describes a “Babylon 3D plugin” and Babylon.js rendering, w...
- plugin-info.ts: `plugin-info.ts` introduces new providers (`babylonInstructions`, `babylonSet...
- README.md: The PR title is “Docs update”, but this change set includes runtime behavior ...
- banner.ts: Unused variable W.
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add blank line before the table to fix m...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`post.content` access is unguarded — pot...
Iteration 1

prr-fix:prrc_kwdoqz480c6nxow_
Iteration 2

prr-fix:prrc_kwdoqz480c6mcbn3
prr-fix:prrc_kwdoqz480c6mcbow
Iteration 3

prr-fix:prrc_kwdoqz480c6mcbok
prr-fix:prrc_kwdoqz480c6mcboz
Changes:
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Inconsistent A2A method count: "80+" her...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- REFACTORING_SUMMARY.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add a language specifier to the fenced c...
- banner.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`line()` truncation slices raw string (w...
- plugin.ts: _⚠️ Potential issue_ | _🟡 Minor_

<details>
<summary>🧩 Analysis chain</summ...
- plugin-info.ts: _⚠️ Potential issue_ | _🟠 Major_

**Instructions describe wrong plugin — "Ba...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Potential NPE if `feed.posts` is undefin...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**CSV row: `@` prefix sits outside the `cs...
- evm.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Logging up to 20 characters of the key v...
- evm.ts: Avoid logging any portion of a private key. `invalidValue: privateKey.substri...
- wallet-validation.ts: `validateAndNormalizePrivateKey` doesn’t currently normalize anything (it ret...
- wallet-validation.test.ts: This test file lives under `src/utils/__tests__`, but `tsconfig.json` only ex...
- plugin-info.ts: The provider text describes a “Babylon 3D plugin” and Babylon.js rendering, w...
- plugin-info.ts: `plugin-info.ts` introduces new providers (`babylonInstructions`, `babylonSet...
- README.md: The PR title is “Docs update”, but this change set includes runtime behavior ...
- banner.ts: Unused variable W.
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add blank line before the table to fix m...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`post.content` access is unguarded — pot...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Incomplete mapping table — appears trunc...
Iteration 2

prr-fix:prrc_kwdoqz480c6mcckc
prr-fix:prrc_kwdoqz480c6mccj9
Copy link

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/services/evm.ts (1)

114-119: ⚠️ Potential issue | 🟠 Major

Private key prefix still logged on line 118 — inconsistent with the new masked approach.

Line 217 correctly uses '••••••' as the mask, but line 118 still logs privateKey.substring(0, 6) + '...', leaking the first 6 hex characters of a valid private key. Even partial key exposure reduces the key's entropy and is a security concern in log aggregation systems.

🔒 Proposed fix
     this.runtime.logger.info({
       rpcUrl,
-      privateKeyPrefix: privateKey.substring(0, 6) + '...',
+      privateKeyPrefix: '••••••',
     }, 'Initializing Base EVM service (foundation layer)');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/services/evm.ts` around lines 114 - 119, The logger call in the Base EVM
service initialization is still leaking the first 6 chars of privateKey; update
the this.runtime.logger.info call (the one initializing BaseEvmService /
"Initializing Base EVM service (foundation layer)") to use the same masked value
used elsewhere (e.g., '••••••') instead of privateKey.substring(0, 6) + '...',
and audit any other uses of privateKey in logging to ensure no partial key
fragments are emitted.
🧹 Nitpick comments (3)
src/banner.ts (2)

92-95: Inconsistent indentation inside printBanner.

Lines 94–95 use 2-space indentation while the rest of the function body (lines 97+, 102+, 119+, 123+) uses 4-space indentation. This appears to be a copy-paste artifact.

♻️ Suggested fix
 export function printBanner(options: BannerOptions): void {
     const { settings, runtime, mode } = options;
-  const R = ANSI.reset, D = ANSI.dim, B = ANSI.bold;
-  const c1 = ANSI.bronze, c2 = ANSI.gold, c3 = ANSI.sand;
+    const R = ANSI.reset, D = ANSI.dim, B = ANSI.bold;
+    const c1 = ANSI.bronze, c2 = ANSI.gold, c3 = ANSI.sand;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/banner.ts` around lines 92 - 95, The indentation in printBanner is
inconsistent: the declarations for R, D, B and c1, c2, c3 use 2-space
indentation while the rest of the function uses 4 spaces; update the indentation
of those lines (the const { settings, runtime, mode } = options; line and the
const R/D/B and const c1/c2/c3 declarations) to match the 4-space style used
throughout printBanner so the function body is consistently indented.

9-23: ANSI color codes don't match their comments.

gold is mapped to \x1b[31m (standard red) and bronze to \x1b[36m (standard cyan). The comments suggest gold/bronze tones, but these are the standard red and cyan ANSI codes respectively. Terminal themes may render these differently, but the comments could confuse future maintainers.

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

In `@src/banner.ts` around lines 9 - 23, The ANSI color mappings in the ANSI
object are incorrect relative to their comments: update the ANSI.gold and
ANSI.bronze entries to use more appropriate codes (e.g. set gold to '\x1b[33m'
for yellow/gold and bronze to a dim yellow like '\x1b[33;2m' to approximate
bronze) or, if you prefer the current red/cyan values, update the inline
comments to reflect that they are red/cyan; modify the ANSI object (symbols:
ANSI, gold, bronze) accordingly so the names, values, and comments are
consistent.
README.md (1)

264-276: Duplicate mapping tables in the same README.

The "Why No Read Actions?" section (lines 264–275) and the "Providers" section (lines 306–317) contain identical mapping tables. Consider keeping only one instance and cross-referencing the other section, to avoid maintenance drift if the mappings change.

Also applies to: 306-318

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

In `@README.md` around lines 264 - 276, Duplicate mapping tables appear in the
"Why No Read Actions?" and "Providers" sections; remove one of the tables and
replace it with a single-source reference to the remaining table (for example,
keep the table under "Providers" and add a short sentence in "Why No Read
Actions?" that links or points to the "Providers" mapping), updating the README
so the mapping (entries like babylon_get_market_data → babylon_markets_full,
babylon_list_markets → babylon_markets, babylon_get_positions →
babylon_positions, etc.) is maintained only once to avoid drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/providers/social-feed.ts`:
- Around line 50-73: The file contains corrupted XML-like edit artefacts that
split and break the return block (remove the stray </search>, </change>, <change
...>, <search> tags) and reconstruct the intended return object so it parses:
replace the fragmented return with a single return that returns text:
rows.join('\n'), data: { posts }, and values: { postCount: String(posts.length),
topPost: posts[0]?.content?.substring(0,100) || '' }; ensure the surrounding
try/catch method (the function that builds rows/posts) properly closes and that
the catch still returns the fallback object (text: 'Unable to fetch social feed
at this time.', data: {}, values: {}).

---

Outside diff comments:
In `@src/services/evm.ts`:
- Around line 114-119: The logger call in the Base EVM service initialization is
still leaking the first 6 chars of privateKey; update the
this.runtime.logger.info call (the one initializing BaseEvmService /
"Initializing Base EVM service (foundation layer)") to use the same masked value
used elsewhere (e.g., '••••••') instead of privateKey.substring(0, 6) + '...',
and audit any other uses of privateKey in logging to ensure no partial key
fragments are emitted.

---

Duplicate comments:
In `@README.md`:
- Around line 1137-1145: There are two identical fenced pipeline diagrams (the
block starting "Posts → Phase 1 (Routing + Actions) → Execute LIKEs → Sentiment
Updates (NO LLM)" and its duplicate) — remove the duplicate block and keep a
single instance to avoid redundancy; locate the two ```text fenced code blocks
that contain the pipeline ASCII art (the "Posts → Phase 1..." diagram) and
delete one of them, ensuring surrounding spacing and any adjacent headings or
references remain correct after removal.

---

Nitpick comments:
In `@README.md`:
- Around line 264-276: Duplicate mapping tables appear in the "Why No Read
Actions?" and "Providers" sections; remove one of the tables and replace it with
a single-source reference to the remaining table (for example, keep the table
under "Providers" and add a short sentence in "Why No Read Actions?" that links
or points to the "Providers" mapping), updating the README so the mapping
(entries like babylon_get_market_data → babylon_markets_full,
babylon_list_markets → babylon_markets, babylon_get_positions →
babylon_positions, etc.) is maintained only once to avoid drift.

In `@src/banner.ts`:
- Around line 92-95: The indentation in printBanner is inconsistent: the
declarations for R, D, B and c1, c2, c3 use 2-space indentation while the rest
of the function uses 4 spaces; update the indentation of those lines (the const
{ settings, runtime, mode } = options; line and the const R/D/B and const
c1/c2/c3 declarations) to match the 4-space style used throughout printBanner so
the function body is consistently indented.
- Around line 9-23: The ANSI color mappings in the ANSI object are incorrect
relative to their comments: update the ANSI.gold and ANSI.bronze entries to use
more appropriate codes (e.g. set gold to '\x1b[33m' for yellow/gold and bronze
to a dim yellow like '\x1b[33;2m' to approximate bronze) or, if you prefer the
current red/cyan values, update the inline comments to reflect that they are
red/cyan; modify the ANSI object (symbols: ANSI, gold, bronze) accordingly so
the names, values, and comments are consistent.

Comment on lines 50 to 73
return {
text: rows.join('\n'),
data: { posts },</search>
</change>

<change path="src/providers/social-feed.ts">
<search> values: {
return {
text: rows.join('\n'),
data: { posts },
values: {
postCount: String(posts.length),
topPost: posts[0]?.content?.substring(0, 100) || '',
},
};
} catch (error) {
return {
text: 'Unable to fetch social feed at this time.',
data: {},
values: {},
};
}
},
};
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: File contains corrupted search/replace markup — code will not parse.

Lines 52–56 contain XML-like </search>, </change>, <change path=...>, <search> tags that are clearly artifacts from an automated edit tool (e.g., Cursor Bugbot). This makes the entire file unparseable — Biome confirms 12+ parse errors starting at line 52. The return statement beginning at line 50 is split across two fragments with garbage in between, and the function never properly closes.

🐛 Proposed fix — reconstruct the intended return block
       return {
         text: rows.join('\n'),
         data: { posts },
-        data: { posts },</search>
-</change>
-
-<change path="src/providers/social-feed.ts">
-<search>        values: {
-          return {
-                  text: rows.join('\n'),
-                  data: { posts },
-                  values: {
-                    postCount: String(posts.length),
-                    topPost: posts[0]?.content?.substring(0, 100) || '',
-                  },
-                };
+        values: {
+          postCount: String(posts.length),
+          topPost: posts[0]?.content?.substring(0, 100) || '',
+        },
+      };
     } catch (error) {
       return {
         text: 'Unable to fetch social feed at this time.',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return {
text: rows.join('\n'),
data: { posts },</search>
</change>
<change path="src/providers/social-feed.ts">
<search> values: {
return {
text: rows.join('\n'),
data: { posts },
values: {
postCount: String(posts.length),
topPost: posts[0]?.content?.substring(0, 100) || '',
},
};
} catch (error) {
return {
text: 'Unable to fetch social feed at this time.',
data: {},
values: {},
};
}
},
};
return {
text: rows.join('\n'),
data: { posts },
values: {
postCount: String(posts.length),
topPost: posts[0]?.content?.substring(0, 100) || '',
},
};
} catch (error) {
return {
text: 'Unable to fetch social feed at this time.',
data: {},
values: {},
};
}
},
};
🧰 Tools
🪛 Biome (2.3.14)

[error] 52-52: Expected a property, a shorthand property, a getter, a setter, or a method but instead found '<'.

Expected a property, a shorthand property, a getter, a setter, or a method here.

(parse)


[error] 52-52: Expected a type parameter but instead found '/'.

Expected a type parameter here.

(parse)


[error] 52-52: expected , but instead found search

Remove search

(parse)


[error] 52-53: Expected a parenthesis '(' but instead found '<'.

Expected a parenthesis '(' here.

(parse)


[error] 53-53: Expected a type parameter but instead found '/'.

Expected a type parameter here.

(parse)


[error] 53-53: expected , but instead found change

Remove change

(parse)


[error] 54-55: Expected a parenthesis '(' but instead found '<'.

Expected a parenthesis '(' here.

(parse)


[error] 55-55: expected , but instead found path

Remove path

(parse)


[error] 55-56: Expected a parenthesis '(' but instead found '<'.

Expected a parenthesis '(' here.

(parse)


[error] 56-56: Expected a parenthesis '(' but instead found 'values'.

Expected a parenthesis '(' here.

(parse)


[error] 57-57: expected : but instead found {

Remove {

(parse)


[error] 64-64: expected , but instead found ;

Remove ;

(parse)

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

In `@src/providers/social-feed.ts` around lines 50 - 73, The file contains
corrupted XML-like edit artefacts that split and break the return block (remove
the stray </search>, </change>, <change ...>, <search> tags) and reconstruct the
intended return object so it parses: replace the fragmented return with a single
return that returns text: rows.join('\n'), data: { posts }, and values: {
postCount: String(posts.length), topPost: posts[0]?.content?.substring(0,100) ||
'' }; ensure the surrounding try/catch method (the function that builds
rows/posts) properly closes and that the catch still returns the fallback object
(text: 'Unable to fetch social feed at this time.', data: {}, values: {}).

odilitime and others added 9 commits February 17, 2026 03:26
Changes:
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Inconsistent A2A method count: "80+" her...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- REFACTORING_SUMMARY.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add a language specifier to the fenced c...
- banner.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`line()` truncation slices raw string (w...
- plugin.ts: _⚠️ Potential issue_ | _🟡 Minor_

<details>
<summary>🧩 Analysis chain</summ...
- plugin-info.ts: _⚠️ Potential issue_ | _🟠 Major_

**Instructions describe wrong plugin — "Ba...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Potential NPE if `feed.posts` is undefin...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**CSV row: `@` prefix sits outside the `cs...
- evm.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Logging up to 20 characters of the key v...
- evm.ts: Avoid logging any portion of a private key. `invalidValue: privateKey.substri...
- wallet-validation.ts: `validateAndNormalizePrivateKey` doesn’t currently normalize anything (it ret...
- wallet-validation.test.ts: This test file lives under `src/utils/__tests__`, but `tsconfig.json` only ex...
- plugin-info.ts: The provider text describes a “Babylon 3D plugin” and Babylon.js rendering, w...
- plugin-info.ts: `plugin-info.ts` introduces new providers (`babylonInstructions`, `babylonSet...
- README.md: The PR title is “Docs update”, but this change set includes runtime behavior ...
- banner.ts: Unused variable W.
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add blank line before the table to fix m...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`post.content` access is unguarded — pot...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Incomplete mapping table — appears trunc...
Changes:
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Inconsistent A2A method count: "80+" her...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- REFACTORING_SUMMARY.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add a language specifier to the fenced c...
- banner.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`line()` truncation slices raw string (w...
- plugin.ts: _⚠️ Potential issue_ | _🟡 Minor_

<details>
<summary>🧩 Analysis chain</summ...
- plugin-info.ts: _⚠️ Potential issue_ | _🟠 Major_

**Instructions describe wrong plugin — "Ba...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Potential NPE if `feed.posts` is undefin...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**CSV row: `@` prefix sits outside the `cs...
- evm.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Logging up to 20 characters of the key v...
- evm.ts: Avoid logging any portion of a private key. `invalidValue: privateKey.substri...
- wallet-validation.ts: `validateAndNormalizePrivateKey` doesn’t currently normalize anything (it ret...
- wallet-validation.test.ts: This test file lives under `src/utils/__tests__`, but `tsconfig.json` only ex...
- plugin-info.ts: The provider text describes a “Babylon 3D plugin” and Babylon.js rendering, w...
- plugin-info.ts: `plugin-info.ts` introduces new providers (`babylonInstructions`, `babylonSet...
- README.md: The PR title is “Docs update”, but this change set includes runtime behavior ...
- banner.ts: Unused variable W.
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add blank line before the table to fix m...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`post.content` access is unguarded — pot...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Incomplete mapping table — appears trunc...
- social-feed.ts: _⚠️ Potential issue_ | _🔴 Critical_

**Critical: File contains corrupted sea...
Iteration 2

prr-fix:prrc_kwdoqz480c6mcbos
prr-fix:prrc_kwdoqz480c6mcckj
prr-fix:prrc_kwdoqz480c6mcckx
Iteration 4

prr-fix:prrc_kwdoqz480c6mcbn7
prr-fix:prrc_kwdoqz480c6nw-2r
prr-fix:prrc_kwdoqz480c6mcbow
prr-fix:prrc_kwdoqz480c6mcckp
Changes:
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Inconsistent A2A method count: "80+" her...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- REFACTORING_SUMMARY.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add a language specifier to the fenced c...
- banner.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`line()` truncation slices raw string (w...
- plugin.ts: _⚠️ Potential issue_ | _🟡 Minor_

<details>
<summary>🧩 Analysis chain</summ...
- plugin-info.ts: _⚠️ Potential issue_ | _🟠 Major_

**Instructions describe wrong plugin — "Ba...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Potential NPE if `feed.posts` is undefin...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**CSV row: `@` prefix sits outside the `cs...
- evm.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Logging up to 20 characters of the key v...
- evm.ts: Avoid logging any portion of a private key. `invalidValue: privateKey.substri...
- wallet-validation.ts: `validateAndNormalizePrivateKey` doesn’t currently normalize anything (it ret...
- wallet-validation.test.ts: This test file lives under `src/utils/__tests__`, but `tsconfig.json` only ex...
- plugin-info.ts: The provider text describes a “Babylon 3D plugin” and Babylon.js rendering, w...
- plugin-info.ts: `plugin-info.ts` introduces new providers (`babylonInstructions`, `babylonSet...
- README.md: The PR title is “Docs update”, but this change set includes runtime behavior ...
- banner.ts: Unused variable W.
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add blank line before the table to fix m...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`post.content` access is unguarded — pot...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Incomplete mapping table — appears trunc...
- social-feed.ts: _⚠️ Potential issue_ | _🔴 Critical_

**Critical: File contains corrupted sea...
Changes:
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Inconsistent A2A method count: "80+" her...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- REFACTORING_SUMMARY.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add a language specifier to the fenced c...
- banner.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`line()` truncation slices raw string (w...
- plugin.ts: _⚠️ Potential issue_ | _🟡 Minor_

<details>
<summary>🧩 Analysis chain</summ...
- plugin-info.ts: _⚠️ Potential issue_ | _🟠 Major_

**Instructions describe wrong plugin — "Ba...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Potential NPE if `feed.posts` is undefin...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**CSV row: `@` prefix sits outside the `cs...
- evm.ts: _⚠️ Potential issue_ | _🟡 Minor_

**Logging up to 20 characters of the key v...
- evm.ts: Avoid logging any portion of a private key. `invalidValue: privateKey.substri...
- wallet-validation.ts: `validateAndNormalizePrivateKey` doesn’t currently normalize anything (it ret...
- wallet-validation.test.ts: This test file lives under `src/utils/__tests__`, but `tsconfig.json` only ex...
- plugin-info.ts: The provider text describes a “Babylon 3D plugin” and Babylon.js rendering, w...
- plugin-info.ts: `plugin-info.ts` introduces new providers (`babylonInstructions`, `babylonSet...
- README.md: The PR title is “Docs update”, but this change set includes runtime behavior ...
- banner.ts: Unused variable W.
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Add blank line before the table to fix m...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Fenced code block missing language speci...
- social-feed.ts: _⚠️ Potential issue_ | _🟡 Minor_

**`post.content` access is unguarded — pot...
- README.md: _⚠️ Potential issue_ | _🟡 Minor_

**Incomplete mapping table — appears trunc...
- social-feed.ts: _⚠️ Potential issue_ | _🔴 Critical_

**Critical: File contains corrupted sea...
Explains reasoning for dismissed issues inline in code
…OS casing

- Add docs/IDENTITY_AND_REPUTATION.md: Agent0 vs Babylon contracts, how plugin fits
- README: link to doc, Related 8004 elizaOS plugins section
- API_REFERENCE, agent-card, babylon-info: ElizaOS -> elizaOS

Co-authored-by: Cursor <cursoragent@cursor.com>
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