Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 feat: ability to cancel current run before any calls to LLM are made by alex-nax · Pull Request #5728 · elizaOS/eliza · GitHub
Nothing Special   »   [go: up one dir, main page]

Skip to content

Conversation

alex-nax
Copy link
@alex-nax alex-nax commented Aug 7, 2025

Background

What does this PR do?

Introduce entity for cancelling runs CancelRunSignal

Why are we doing this? Any context or related work?

  • Calls to LLMs usually cost some credits
  • When we receive the RUN_STARTED event we can check current entity and end run to prevent credits spending

Documentation changes needed?

Methods

  • static getSignal(runId: UUID) - get signal by runId or create if null
  • static clear(runId: UUID) - clear signal from map
  • cancel(content?: Content) - cancel current run and and send content as a response to user

Example

import { Content, EventType, Plugin } from "@elizaos/core";
import { CancelRunSignal } from "@elizaos/plugin-bootstrap";

// consider we have a service to determine eligibility for entity
interface EligibilityService {
  check(entityId: UUID): Promise<{ result: boolean, reason?: Content }>
}

const plugin: Plugin = {
...
  events: {
    [EventType.RUN_STARTED]: ({ entityId, runId, runtime }) => {
      const service = runtime.getService<EligibilityService>("USER_MANAGEMENT");
      const { result, reason } = await service.check(entityId);
      
      if (!result) {
        const signal = CancelRunSignal.getSignal(runId);
        signal.cancel(reason);
      }
    },
    ...
  },
  ...
}

export default Plugin;

Discord username

alexd000

Summary by CodeRabbit

  • New Features

    • Added user-initiated run cancellation. In-flight processing can be interrupted, sends a cancellation response, and marks the run as ended. Processing now checks for cancellation to avoid unnecessary work and ensures cleanup on completion or timeout.
  • Chores

    • Promoted the suite from alpha to beta with version updates across all packages. No functional changes outside the new cancellation capability.

Copy link
Contributor
coderabbitai bot commented Aug 7, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

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

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

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Version identifiers were updated from 1.5.9-alpha.18 to 1.5.9-beta.1 across the repo. Additionally, plugin-bootstrap introduced a new CancelRunSignal class and integrated run-level cancellation into the message handling flow, racing processing against timeout and external cancellation and emitting a cancelled run event.

Changes

Cohort / File(s) Summary of Changes
Release metadata updates
lerna.json, packages/.../package.json (api-client, app, cli, client, config, core, elizaos, plugin-bootstrap, plugin-dummy-services, plugin-quick-starter, plugin-sql, plugin-starter, project-starter, project-tee-starter, server, test-utils)
Bumped version fields from 1.5.9-alpha.18 to 1.5.9-beta.1; no other modifications.
Bootstrap cancellation feature
packages/plugin-bootstrap/src/index.ts
Added exported CancelRunSignal class; integrated per-run cancellation into handler via Promise.race with processing, timeout, and cancel promises; added cleanup and cancelled run event emission.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User as External Canceller
  participant H as Bootstrap Handler
  participant CRS as CancelRunSignal
  participant P as Processing
  participant M as Memory Store
  participant E as EventBus

  rect rgba(230,245,255,0.6)
    Note over H,CRS: Run starts (runId)
    H->>CRS: getSignal(runId)
    H->>P: start processing
    par Race: processing/timeout/cancel
      H-->>H: await Promise.race([process, timeout, cancel])
    and
      User-->>CRS: cancel(runId, content?)
      CRS-->>H: resolve cancel promise
    end
  end

  alt Cancel received
    H->>H: mark isCancelled
    H->>M: persist cancellation memory
    H->>E: emit RUN_ENDED(status: "cancelled")
  else Timeout
    H->>CRS: clear(runId)
    H->>E: emit RUN_ENDED(status: "timeout")
  else Completed
    H->>E: emit RUN_ENDED(status: "success")
  end

  H->>CRS: clear(runId)
  Note over H,CRS: Cleanup per-run signal
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

1.x

Suggested reviewers

  • 0xbbjoker
  • tcm390
  • wtfsayo

Poem

Beta breeze across the code, we sail ⛵
Alpha tags retire, tidy as a trail.
A whisper: “Cancel!”—runs now heed the sign,
Signals race with time on a slender line.
Logs inscribe the tale, events take flight—
Version bumps align, the flow turns light.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description provides a clear background, rationale, API method signatures, an example usage, and the author's contact, but it omits required template fields: the top-level "Relates to" link and the mandatory "Risks" section, and it does not state "What kind of change is this?" or include testing instructions ("Where should a reviewer start?" and "Detailed testing steps"), so it does not fully comply with the repository template. Please add a "Relates to" link to the relevant issue or ticket, fill the "Risks" section with severity and affected areas, declare the change type (e.g., "Feature"), and provide testing instructions including where a reviewer should start, step-by-step test cases, expected results, and any deployment or documentation notes.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title concisely and accurately states the primary change: adding the ability to cancel a run before any LLM calls are made (matches the new CancelRunSignal and its integration in plugin-bootstrap). It uses conventional-commit style ("feat:") and is specific enough for reviewers and history scanning.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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
graphite-app bot commented Aug 7, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • merge-queue-hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link
cursor bot commented Aug 7, 2025

Bugbot found 1 bug

To see it, have a team admin activate your membership in the Cursor dashboard.

@wtfsayo wtfsayo requested review from tcm390 and wtfsayo August 14, 2025 15:28
cursor[bot]

This comment was marked as outdated.

@wtfsayo wtfsayo requested a review from 0xbbjoker August 19, 2025 14:03
@standujar
Copy link
Collaborator

@coderabbitai review

Copy link
Contributor
coderabbitai bot commented Sep 19, 2025
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

8000

Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

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

⚠️ Outside diff range comments (1)
packages/plugin-bootstrap/src/index.ts (1)

487-505: Signal cleanup in timeout handler prevents proper cancellation.

The timeout promise clears the cancel signal, which could prevent a legitimate cancellation from being processed if it arrives just before the timeout.

   const timeoutPromise = new Promise<never>((_, reject) => {
     timeoutId = setTimeout(async () => {
-      CancelRunSignal.clear(runId);
+      // Mark as timed out but don't clear - let finally handle cleanup
+      cancelSignal.cancel(); // Cancel with no content to indicate timeout
       await runtime.emitEvent(EventType.RUN_TIMEOUT, {
         runtime,
         runId,
         messageId: message.id,
         roomId: message.roomId,
         entityId: message.entityId,
         startTime,
         status: 'timeout',
         endTime: Date.now(),
         duration: Date.now() - startTime,
         error: 'Run exceeded 60 minute timeout',
         source: 'messageHandler',
       });
       reject(new Error('Run exceeded 60 minute timeout'));
     }, timeoutDuration);
   });
♻️ Duplicate comments (3)
packages/plugin-bootstrap/src/index.ts (3)

445-485: Critical: Race conditions in cancellation promise handling.

The cancelPromise implementation has multiple issues:

  1. Clears the signal immediately after wait() resolves, preventing other cleanup code from accessing it
  2. No error handling for memory creation or event emission failures
  3. Missing validation that the cancellation content is appropriate for the context
   const cancelPromise = (async () => {
     const content = await cancelSignal.wait();
-    CancelRunSignal.clear(runId);
+    // Don't clear here - let the finally block handle it

     if (content) {
+      try {
         if (message.id) {
           content.inReplyTo = createUniqueUuid(runtime, message.id);
         }

         await callback(content);

         const cancelMemory = {
           id: asUUID(v4()),
           entityId: runtime.agentId,
           agentId: runtime.agentId,
           content,
           roomId: message.roomId,
           createdAt: Date.now(),
         };

         await runtime.createMemory(cancelMemory, 'messages');
         logger.debug('[Bootstrap] Saved cancel response to memory', {
           memoryId: cancelMemory.id,
         });
+      } catch (error) {
+        logger.error('[Bootstrap] Error handling cancellation:', error);
+        // Re-throw to ensure proper error propagation
+        throw error;
+      }
     }

     await runtime.emitEvent(EventType.RUN_ENDED, {
       runtime,
       runId,
       messageId: message.id,
       roomId: message.roomId,
       entityId: message.entityId,
       startTime,
       status: 'cancelled',
       endTime: Date.now(),
       duration: Date.now() - startTime,
       source: 'messageHandler',
     });
   })();

914-914: Race condition with Promise.race causing unhandled rejections.

The current Promise.race implementation allows the processing promise to continue running after cancellation, potentially causing duplicate RUN_ENDED events and unhandled promise rejections.

Consider using AbortController for proper cancellation:

+  const abortController = new AbortController();
+  
   const processingPromise = (async () => {
     try {
+      // Check abort signal periodically
+      if (abortController.signal.aborted) return;
+      
       // ... existing processing code ...
     } catch (error: any) {
+      if (abortController.signal.aborted) return;
       // ... existing error handling ...
     }
   })();

-  await Promise.race([processingPromise, timeoutPromise, cancelPromise]);
+  try {
+    const result = await Promise.race([processingPromise, timeoutPromise, cancelPromise]);
+    abortController.abort(); // Cancel any ongoing work
+    return result;
+  } finally {
+    abortController.abort(); // Ensure cleanup
+  }

351-382: Critical: Thread-safety and memory leak issues in CancelRunSignal.

The implementation has several concurrency and lifecycle issues:

  1. Race condition: No synchronization when accessing the static byRunId Map from multiple concurrent requests
  2. Memory leak: Signals may not be cleared if cancellation completes before the timeout promise
  3. Double cleanup risk: Both cancelPromise and processingPromise call CancelRunSignal.clear(runId)

Consider these fixes:

 export class CancelRunSignal {
-  private static byRunId: Map<UUID, CancelRunSignal> = new Map();
+  private static readonly byRunId: Map<UUID, CancelRunSignal> = new Map();
+  private static readonly lock = new Map<UUID, Promise<void>>();
   private resolve?: (content?: Content) => void;
   private promise: Promise<Content | undefined>;
   public isCancelled = false;
+  private cleared = false;
+  
   constructor() {
     this.promise = new Promise<Content | undefined>((resolve) => {
       this.resolve = resolve;
     });
   }

   cancel(content?: Content) {
+    if (this.cleared) return;
     this.isCancelled = true;
     this.resolve?.(content);
   }

   wait() {
     return this.promise;
   }

-  static getSignal(runId: UUID) {
+  static async getSignal(runId: UUID) {
+    // Ensure thread-safe access
+    while (this.lock.has(runId)) {
+      await this.lock.get(runId);
+    }
+    
+    const lockPromise = Promise.resolve();
+    this.lock.set(runId, lockPromise);
+    
+    try {
       if (!this.byRunId.has(runId)) {
         this.byRunId.set(runId, new CancelRunSignal());
       }
       return this.byRunId.get(runId)!;
+    } finally {
+      this.lock.delete(runId);
+    }
   }

   static clear(runId: UUID) {
-    this.byRunId.delete(runId);
+    const signal = this.byRunId.get(runId);
+    if (signal && !signal.cleared) {
+      signal.cleared = true;
+      this.byRunId.delete(runId);
+    }
   }
 }
🧹 Nitpick comments (3)
packages/test-utils/package.json (1)

4-4: Version bump OK.

Minor: zod is pinned to 3.24.2 here while other packages use ^3.24.4; consider harmonizing to avoid duplicate installs.

packages/plugin-bootstrap/src/index.ts (2)

547-550: Add more comprehensive cancellation checks.

The cancellation check after memory creation is good, but consider adding checks at other critical points to avoid unnecessary work.

   if (cancelSignal.isCancelled) {
     return;
   }

   const agentUserState = await runtime.getParticipantUserState(
     message.roomId,
     runtime.agentId
   );
+  
+  if (cancelSignal.isCancelled) {
+    return;
+  }

   // ... later in the code ...

   if (message.content.attachments && message.content.attachments.length > 0) {
+    if (cancelSignal.isCancelled) {
+      return;
+    }
     message.content.attachments = await processAttachments(
       message.content.attachments,
       runtime
     );

362-365: Consider adding cancellation reason tracking.

The cancel method accepts optional content but doesn't track the reason for cancellation, which could be useful for debugging and analytics.

+  public cancellationReason?: string;
+  
-  cancel(content?: Content) {
+  cancel(content?: Content, reason?: string) {
     this.isCancelled = true;
+    this.cancellationReason = reason;
     this.resolve?.(content);
   }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed f 8000 rom the base of the PR and between 0029a36 and 5b2cf00.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (18)
  • lerna.json (1 hunks)
  • packages/api-client/package.json (1 hunks)
  • packages/app/package.json (1 hunks)
  • packages/cli/package.json (1 hunks)
  • packages/client/package.json (1 hunks)
  • packages/config/package.json (1 hunks)
  • packages/core/package.json (1 hunks)
  • packages/elizaos/package.json (1 hunks)
  • packages/plugin-bootstrap/package.json (1 hunks)
  • packages/plugin-bootstrap/src/index.ts (4 hunks)
  • packages/plugin-dummy-services/package.json (1 hunks)
  • packages/plugin-quick-starter/package.json (1 hunks)
  • packages/plugin-sql/package.json (1 hunks)
  • packages/plugin-starter/package.json (1 hunks)
  • packages/project-starter/package.json (1 hunks)
  • packages/project-tee-starter/package.json (1 hunks)
  • packages/server/package.json (1 hunks)
  • packages/test-utils/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (14)
📚 Learning: 2025-07-28T23:42:53.140Z
Learnt from: CR
PR: elizaOS/eliza#0
File: packages/project-starter/CLAUDE.md:0-0
Timestamp: 2025-07-28T23:42:53.140Z
Learning: Applies to packages/project-starter/**/package.json : Use `elizaos` CLI scripts in `package.json` for starting, developing, testing, and building the agent

Applied to files:

  • packages/server/package.json
  • packages/cli/package.json
  • packages/project-starter/package.json
  • packages/elizaos/package.json
  • packages/project-tee-starter/package.json
  • packages/plugin-quick-starter/package.json
📚 Learning: 2025-08-04T09:25:57.393Z
Learnt from: CR
PR: elizaOS/eliza#0
File: packages/cli/src/utils/upgrade/CLAUDE.md:0-0
Timestamp: 2025-08-04T09:25:57.393Z
Learning: Applies to packages/cli/src/utils/upgrade/**/package.json : Update package.json to ensure the package name uses the elizaos-plugins/ prefix, dependencies are updated (especially elizaos/core), scripts are correct, and agentConfig section is present.

Applied to files:

  • packages/cli/package.json
  • packages/elizaos/package.json
📚 Learning: 2025-05-08T09:37:35.805Z
Learnt from: wtfsayo
PR: elizaOS/eliza#4493
File: packages/docs/docs/core/plugins.md:95-101
Timestamp: 2025-05-08T09:37:35.805Z
Learning: The ElizaOS CLI uses the plural form "plugins" for plugin management commands (e.g., "elizaos plugins add", "elizaos plugins remove", "elizaos plugins list"), while the singular form "plugin" is used for plugin development operations (e.g., "elizaos plugin publish").

Applied to files:

  • packages/cli/package.json
📚 Learning: 2025-08-08T14:26:42.742Z
Learnt from: CR
PR: elizaOS/eliza#0
File: .cursorrules:0-0
Timestamp: 2025-08-08T14:26:42.742Z
Learning: Import Pattern: Use elizaos/core in package code, packages/core in internal references

Applied to files:

  • packages/core/package.json
📚 Learning: 2025-08-28T20:11:19.074Z
Learnt from: CR
PR: elizaOS/eliza#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-28T20:11:19.074Z
Learning: Applies to packages/!(core)/**/src/**/*.{ts,tsx} : In package code outside core, import elizaos/core (not 'packages/core')

Applied to files:

  • packages/core/package.json
📚 Learning: 2025-08-30T13:49:37.549Z
Learnt from: standujar
PR: elizaOS/eliza#5848
File: packages/core/build.ts:142-146
Timestamp: 2025-08-30T13:49:37.549Z
Learning: In elizaos/core package, the root dist/index.d.ts file is automatically generated by tsc when running `tsc --project tsconfig.declarations.json` with multiple entry points (src/index.node.ts and src/index.browser.ts). This generates generic type definitions that work for all environments, and manually overwriting this file would break browser support.

Applied to files:

  • packages/core/package.json
📚 Learning: 2025-06-22T17:42:23.153Z
Learnt from: wtfsayo
PR: elizaOS/eliza#0
File: :0-0
Timestamp: 2025-06-22T17:42:23.153Z
Learning: In the elizaOS/eliza repository, always use bun:test for testing instead of jest or vitest. Import testing utilities from 'bun:test' rather than 'jest/globals' or other testing frameworks.

Applied to files:

  • packages/test-utils/package.json
📚 Learning: 2025-05-28T16:15:33.419Z
Learnt from: yungalgo
PR: elizaOS/eliza#4813
File: packages/project-starter/package.json:9-9
Timestamp: 2025-05-28T16:15:33.419Z
Learning: Project starter packages like elizaos/project-starter are templates that users copy rather than install as dependencies, so minor path inconsistencies in package.json entry points are less critical than for published packages.

Applied to files:

  • packages/project-starter/package.json
  • packages/project-tee-starter/package.json
  • packages/plugin-starter/package.json
📚 Learning: 2025-07-28T23:42:53.140Z
Learnt from: CR
PR: elizaOS/eliza#0
File: packages/project-starter/CLAUDE.md:0-0
Timestamp: 2025-07-28T23:42:53.140Z
Learning: Applies to packages/project-starter/src/plugin.ts : Define project-specific custom plugins in `src/plugin.ts` using the `Plugin` interface from `elizaos/core`

Applied to files:

  • packages/project-starter/package.json
  • packages/plugin-quick-starter/package.json
  • packages/plugin-starter/package.json
📚 Learning: 2025-08-04T09:25:57.393Z
Learnt from: CR
PR: elizaOS/eliza#0
File: packages/cli/src/utils/upgrade/CLAUDE.md:0-0
Timestamp: 2025-08-04T09:25:57.393Z
Learning: Applies to packages/cli/src/utils/upgrade/**/{tsconfig.json,tsconfig.build.json,tsup.config.ts} : Create and configure TypeScript and build configuration files: tsconfig.json, tsconfig.build.json, and tsup.config.ts as required for ElizaOS 1.x.

Applied to files:

  • packages/elizaos/package.json
📚 Learning: 2025-08-28T20:11:19.074Z
Learnt from: CR
PR: elizaOS/eliza#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-28T20:11:19.074Z
Learning: Applies to **/package.json : Use workspace:* for all elizaos/* dependencies; never hardcode internal package versions

Applied to files:

  • packages/elizaos/package.json
📚 Learning: 2025-09-17T22:22:35.096Z
Learnt from: CR
PR: elizaOS/eliza#0
File: AGENTS.md:0-0
Timestamp: 2025-09-17T22:22:35.096Z
Learning: Applies to packages/cli/** : packages/cli contains the elizaos CLI; CLI code should live here

Applied to files:

  • packages/elizaos/package.json
📚 Learning: 2025-07-28T23:42:39.951Z
Learnt from: CR
PR: elizaOS/eliza#0
File: packages/plugin-starter/CLAUDE.md:0-0
Timestamp: 2025-07-28T23:42:39.951Z
Learning: Applies to packages/plugin-starter/**/package.json : Use the provided package.json template as a basis for your plugin's package.json

Applied to files:

  • packages/plugin-starter/package.json
📚 Learning: 2025-07-28T23:42:39.951Z
Learnt from: CR
PR: elizaOS/eliza#0
File: packages/plugin-starter/CLAUDE.md:0-0
Timestamp: 2025-07-28T23:42:39.951Z
Learning: Applies to packages/plugin-starter/src/index.ts : The main plugin export must follow the specified pattern in src/index.ts, exporting a Plugin object with services, actions, and optional providers/evaluators

Applied to files:

  • packages/plugin-starter/package.json
🔇 Additional comments (17)
packages/plugin-quick-starter/package.json (1)

4-4: Version bump OK.

No runtime/behavioral impact here.

packages/elizaos/package.json (1)

3-3: Alias package version updated — looks good.

Keeps the alias aligned with the CLI release.

packages/config/package.json (1)

4-4: Version bump OK.

No other manifest changes.

packages/server/package.json (1)

3-3: Version bump OK.

No server dependency changes; safe to ship.

packages/plugin-sql/package.json (1)

3-3: Version bump OK.

No export map or build changes.

packages/project-tee-starter/package.json (1)

4-4: Version bump OK.

Starter template only; no runtime impact.

packages/cli/package.json (1)

3-3: Version bump looks good

No functional changes; aligns with monorepo beta bump.

packages/client/package.json (1)

3-3: Version bump acknowledged

Consistent with repo-wide update.

packages/plugin-dummy-services/package.json (1)

3-3: Version bump consistent

No additional changes detected.

packages/project-starter/package.json (1)

4-4: Version bump OK

Template scripts still use elizaos CLI as expected.

packages/plugin-starter/package.json (1)

4-4: Version bump OK

Starter remains metadata-only change.

packages/app/package.json (1)

3-3: Version bump OK

No runtime config changes alongside the bump.

packages/plugin-bootstrap/package.json (1)

3-3: Version bump OK — CancelRunSignal exported

CancelRunSignal is exported from packages/plugin-bootstrap/src/index.ts (export class CancelRunSignal). No dist/types in repo; type artifacts will be validated in CI.

lerna.json (1)

2-2: Update publish commit message to reflect beta releases

lerna.json:9 still contains "chore(release): publish alpha" — change to a neutral placeholder so release commit messages aren't misleading.

-      "message": "chore(release): publish alpha",
+      "message": "chore(release): publish %s",
  • Note: repository still contains other "alpha" usages (package.json release:alpha script, .github/workflows/release.yaml, tests). Verify whether those should be updated too.
packages/api-client/package.json (1)

3-3: Version bump looks good.

The version update from alpha to beta aligns with the introduction of the new cancellation feature.

packages/plugin-bootstrap/src/index.ts (2)

909-911: Good cleanup placement in finally block.

The placement of CancelRunSignal.clear(runId) in the finally block ensures cleanup happens regardless of how the processing completes.


371-377: Confirm single-thread assumption or add synchronization for CancelRunSignal.byRunId

getSignal/clear are used in packages/plugin-bootstrap/src/index.ts (≈lines 445, 449, 489, 910) and no locking was found around those calls. Under Node's single-threaded event loop this is safe; if this code may run in worker_threads or any shared-memory/multi-threaded context, make access atomic — either confine mutations to a single owner/actor, add a mutex/Atomics-backed lock, or use an out-of-process store.

{
"name": "@elizaos/core",
"version": "1.5.9-alpha.18",
"version": "1.5.9-beta.1",
Copy link
10928
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

🧩 Analysis chain

Core package version bump OK.

Please verify repo-wide consistency (all packages at 1.5.9-beta.1 and internal deps use workspace:*).

Run this read-only script from repo root:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

TARGET_VERSION="1.5.9-beta.1"
echo "Checking versions == ${TARGET_VERSION} in packages/*:"
fd -a 'package.json' packages -E node_modules -E dist | while read -r f; do
  v=$(jq -r '.version // empty' "$f")
  if [[ -n "$v" && "$v" != "$TARGET_VERSION" ]]; then
    echo "Mismatch: $f -> $v"
  fi
done

if [[ -f lerna.json ]]; then
  lv=$(jq -r '.version // empty' lerna.json)
  [[ "$lv" == "$TARGET_VERSION" ]] || echo "lerna.json version mismatch: $lv"
fi

echo "Checking @elizaos/* deps use workspace:*:"
fd -a 'package.json' packages -E node_modules -E dist | while read -r f; do
  for field in dependencies devDependencies optionalDependencies peerDependencies; do
    jq -r --arg fld "$field" '
      .[$fld] // {} | to_entries[]
      | select(.key | test("^@elizaos/"))
      | "\($fld) \(.key) \(.value)"
    ' "$f" | while read -r fld name val; do
      [[ "$val" == "workspace:*" ]] || echo "Non-workspace dep: $f -> [$fld] $name=$val"
    done
  done
done

Length of output: 108


🏁 Script executed:

#!/bin/bash
set -euo pipefail

TARGET_VERSION="1.5.9-beta.1"
echo "Checking versions == ${TARGET_VERSION} in packages/*:"
found=0
while IFS= read -r -d '' f; do
  found=1
  v=$(jq -r '.version // empty' "$f" 2>/dev/null || echo "")
  if [ -n "$v" ] && [ "$v" != "$TARGET_VERSION" ]; then
    echo "Mismatch: $f -> $v"
  fi
done < <(find packages -name package.json -print0)

if [ -f lerna.json ]; then
  lv=$(jq -r '.version // empty' lerna.json 2>/dev/null || echo "")
  if [ -n "$lv" ] && [ "$lv" != "$TARGET_VERSION" ]; then
    echo "lerna.json version mismatch: $lv"
  fi
fi

echo "Checking @elizaos/* deps use workspace:*:"
while IFS= read -r -d '' f; do
  for field in dependencies devDependencies optionalDependencies peerDependencies; do
    jq -r --arg field "$field" '
      (.[$field] // {}) | to_entries[] | select(.key | test("^@elizaos/")) | "\($field) \(.key) \(.value)"
    ' "$f" 2>/dev/null | while IFS= read -r line; do
      fld=$(printf '%s' "$line" | awk '{print $1}')
      name=$(printf '%s' "$line" | awk '{print $2}')
      val=$(printf '%s' "$line" | awk '{print $3}')
      if [ "$val" != "workspace:*" ]; then
        echo "Non-workspace dep: $f -> [$fld] $name=$val"
      fi
    done
  done
done < <(find packages -name package.json -print0)

if [ "$found" -eq 0 ]; then
  echo "No package.json files found under packages/"
fi

Length of output: 106


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

TARGET_VERSION="1.5.9-beta.1"
echo "Checking versions == ${TARGET_VERSION} in packages/*:"

# bail early if no packages
if ! find packages -type f -name package.json -print -quit >/dev/null 2>&1; then
  echo "No package.json files found under packages/"
  exit 0
fi

# check package versions
find packages -type f -name package.json -print0 | while IFS= read -r -d '' f; do
  v=$(jq -r '.version // empty' "$f" 2>/dev/null || echo "")
  if [ -z "$v" ]; then
    echo "Missing version: $f"
  elif [ "$v" != "$TARGET_VERSION" ]; then
    echo "Mismatch: $f -> $v"
  fi
done

# check lerna.json if present
if [ -f lerna.json ]; then
  lv=$(jq -r '.version // empty' lerna.json 2>/dev/null || echo "")
  if [ -n "$lv" ] && [ "$lv" != "$TARGET_VERSION" ]; then
    echo "lerna.json version mismatch: $lv"
  fi
fi

echo "Checking @elizaos/* deps use workspace:*:"
find packages -type f -name package.json -print0 | while IFS= read -r -d '' f; do
  for field in dependencies devDependencies optionalDependencies peerDependencies; do
    jq -r --arg field "$field" '(.[$field] // {}) | to_entries[]? | "\($field) \(.key) \(.value)"' "$f" 2>/dev/null | while IFS= read -r line; do
      fld=$(awk '{print $1}' <<<"$line")
      name=$(awk '{print $2}' <<<"$line")
      val=$(awk '{print $3}' <<<"$line")
      if [ "$val" != "workspace:*" ]; then
        echo "Non-workspace dep: $f -> [$fld] $name=$val"
      fi
    done
  done
done

Length of output: 23050


Core package version bump — fixes required.

  • packages/server/examples/package.json — version is 1.2.6; set to "1.5.9-beta.1".
  • packages/project-tee-starter/package.json — dependency @elizaos/plugin-redpill is pinned to 1.2.1; change to "workspace:*".
🤖 Prompt for AI Agents
In packages/core/package.json around line 3 (version "1.5.9-beta.1"), update the
other package files to match this bump: open
packages/server/examples/package.json and set its "version" to "1.5.9-beta.1",
and open packages/project-tee-starter/package.json and change the dependency
entry for @elizaos/plugin-redpill from the pinned "1.2.1" to the workspace
reference "workspace:*"; save both files and run a quick install/check to ensure
lockfiles and workspace resolutions remain consistent.

@odilitime
Copy link
Collaborator

not sure this is needed, you can just use env to default to mute rooms and unmute for active users

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.

5 participants

0