Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(smoke): improve smoke test steps and reduce node_modules cleanup #2548

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ jobs:
smoke-tests:
runs-on: ubuntu-latest
container:
image: node:23-bullseye
image: node:23.3.0-bullseye # Exact version to match smokeTests.sh requirement
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
NODE_OPTIONS: --no-node-snapshot --experimental-loader=ts-node/esm/transpile-only # Configure Node.js for ESM and native modules
DISABLE_PLUGINS: true # Disable plugins during smoke tests
TS_NODE_TRANSPILE_ONLY: true # Speed up ts-node by skipping type checking
NODE_NO_WARNINGS: 1 # Suppress experimental warnings
steps:
- uses: actions/checkout@v4

Expand Down
145 changes: 73 additions & 72 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,73 +1,74 @@
{
"name": "eliza",
"scripts": {
"format": "biome format --write .",
"lint": "biome lint .",
"check": "biome check --apply .",
"preinstall": "npx only-allow pnpm",
"build": "turbo run build --filter=!eliza-docs",
"build-docker": "turbo run build",
"cleanstart": "if [ -f agent/data/db.sqlite ]; then rm agent/data/db.sqlite; fi && pnpm --filter \"@elizaos/agent\" start --isRoot",
"cleanstart:debug": "if [ -f agent/data/db.sqlite ]; then rm agent/data/db.sqlite; fi && cross-env NODE_ENV=development VERBOSE=true DEBUG=eliza:* pnpm --filter \"@elizaos/agent\" start --isRoot",
"start": "pnpm --filter \"@elizaos/agent\" start --isRoot",
"start:client": "pnpm --dir client dev",
"start:debug": "cross-env NODE_ENV=development VERBOSE=true DEBUG=eliza:* pnpm --filter \"@elizaos/agent\" start --isRoot",
"dev": "bash ./scripts/dev.sh",
"release": "pnpm build && pnpm format && npx lerna publish --no-private --force-publish",
"clean": "bash ./scripts/clean.sh",
"docker:build": "bash ./scripts/docker.sh build",
"docker:run": "bash ./scripts/docker.sh run",
"docker:bash": "bash ./scripts/docker.sh bash",
"docker:start": "bash ./scripts/docker.sh start",
"docker": "pnpm docker:build && pnpm docker:run && pnpm docker:bash",
"test": "bash ./scripts/test.sh",
"smokeTests": "bash ./scripts/smokeTests.sh",
"integrationTests": "bash ./scripts/integrationTests.sh"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@commitlint/cli": "18.6.1",
"@commitlint/config-conventional": "18.6.3",
"@types/jest": "^29.5.11",
"concurrently": "9.1.0",
"cross-env": "7.0.3",
"husky": "9.1.7",
"jest": "^29.7.0",
"lerna": "8.1.5",
"only-allow": "1.2.1",
"turbo": "2.3.3",
"typedoc": "0.26.11",
"typescript": "5.6.3",
"viem": "2.21.58",
"vite": "5.4.11",
"vitest": "2.1.5"
},
"pnpm": {
"overrides": {
"onnxruntime-node": "1.20.1",
"viem": "2.21.58"
}
},
"engines": {
"node": "23.3.0"
},
"dependencies": {
"@0glabs/0g-ts-sdk": "0.2.1",
"@coinbase/coinbase-sdk": "0.10.0",
"@deepgram/sdk": "^3.9.0",
"@injectivelabs/sdk-ts": "^1.14.33",
"@vitest/eslint-plugin": "1.0.1",
"amqplib": "0.10.5",
"csv-parse": "5.6.0",
"langdetect": "^0.2.1",
"ollama-ai-provider": "0.16.1",
"optional": "0.1.4",
"pnpm": "9.14.4",
"sharp": "0.33.5",
"tslog": "4.9.3"
},
"packageManager": "[email protected]+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee",
"workspaces": [
"packages/*"
]
}
"name": "eliza",
"scripts": {
"format": "biome format --write .",
"lint": "biome lint .",
"check": "biome check --apply .",
"preinstall": "npx only-allow pnpm",
"build": "turbo run build --filter=!eliza-docs",
"build-docker": "turbo run build",
"cleanstart": "if [ -f agent/data/db.sqlite ]; then rm agent/data/db.sqlite; fi && pnpm --filter \"@elizaos/agent\" start --isRoot",
"cleanstart:debug": "if [ -f agent/data/db.sqlite ]; then rm agent/data/db.sqlite; fi && cross-env NODE_ENV=development VERBOSE=true DEBUG=eliza:* pnpm --filter \"@elizaos/agent\" start --isRoot",
"start": "pnpm --filter \"@elizaos/agent\" start --isRoot",
"start:client": "pnpm --dir client dev",
"start:debug": "cross-env NODE_ENV=development VERBOSE=true DEBUG=eliza:* pnpm --filter \"@elizaos/agent\" start --isRoot",
"dev": "bash ./scripts/dev.sh",
"release": "pnpm build && pnpm format && npx lerna publish --no-private --force-publish",
"clean": "bash ./scripts/clean.sh",
"docker:build": "bash ./scripts/docker.sh build",
"docker:run": "bash ./scripts/docker.sh run",
"docker:bash": "bash ./scripts/docker.sh bash",
"docker:start": "bash ./scripts/docker.sh start",
"docker": "pnpm docker:build && pnpm docker:run && pnpm docker:bash",
"test": "bash ./scripts/test.sh",
"smokeTests": "bash ./scripts/smokeTests.sh",
"integrationTests": "bash ./scripts/integrationTests.sh"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@commitlint/cli": "18.6.1",
"@commitlint/config-conventional": "18.6.3",
"@types/jest": "^29.5.11",
"concurrently": "9.1.0",
"cross-env": "7.0.3",
"husky": "9.1.7",
"jest": "^29.7.0",
"lerna": "8.1.5",
"only-allow": "1.2.1",
"turbo": "2.3.3",
"typedoc": "0.26.11",
"typescript": "5.6.3",
"viem": "2.21.58",
"vite": "5.4.11",
"vitest": "2.1.5"
},
"pnpm": {
"overrides": {
"onnxruntime-node": "1.20.1",
"viem": "2.21.58",
"bs58": "6.0.0"
}
},
"engines": {
"node": "23.3.0"
},
"dependencies": {
"@0glabs/0g-ts-sdk": "0.2.1",
"@coinbase/coinbase-sdk": "0.10.0",
"@deepgram/sdk": "^3.9.0",
"@injectivelabs/sdk-ts": "^1.14.33",
"@vitest/eslint-plugin": "1.0.1",
"amqplib": "0.10.5",
"csv-parse": "5.6.0",
"langdetect": "^0.2.1",
"ollama-ai-provider": "0.16.1",
"optional": "0.1.4",
"pnpm": "9.14.4",
"sharp": "0.33.5",
"tslog": "4.9.3"
},
"packageManager": "[email protected]+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee",
"workspaces": [
"packages/*"
]
}
9 changes: 9 additions & 0 deletions packages/client-direct/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,22 @@ export class DirectClient {
public jsonToCharacter: Function; // Store jsonToCharacter functor

constructor() {
elizaLogger.info("=== Starting DirectClient initialization ===");
elizaLogger.log("DirectClient constructor");
this.app = express();
this.app.use(cors());
this.agents = new Map();
elizaLogger.info("Express app and CORS middleware initialized");

elizaLogger.info("Configuring middleware...");
this.app.use(bodyParser.json());
this.app.use(bodyParser.urlencoded({ extended: true }));

// Add a status endpoint for health checks
this.app.get('/status', (req, res) => {
res.json({ status: 'ok', timestamp: Date.now() });
});
elizaLogger.info("Body parser and status endpoint configured");

// Serve both uploads and generated images
this.app.use(
Expand Down
79 changes: 60 additions & 19 deletions packages/core/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,28 +402,69 @@ export class AgentRuntime implements IAgentRuntime {

this.token = opts.token;

this.plugins = [
...(opts.character?.plugins ?? []),
...(opts.plugins ?? []),
];

this.plugins.forEach((plugin) => {
plugin.actions?.forEach((action) => {
this.registerAction(action);
});
// Only load plugins if not explicitly disabled
// Handle plugin loading with proper error handling
if (process.env.DISABLE_PLUGINS === 'true') {
elizaLogger.info('Plugins disabled via DISABLE_PLUGINS environment variable');
this.plugins = [];
} else {
try {
this.plugins = [
...(opts.character?.plugins ?? []),
...(opts.plugins ?? []),
];

plugin.evaluators?.forEach((evaluator) => {
this.registerEvaluator(evaluator);
});
for (const plugin of this.plugins) {
try {
// Register plugin components with individual error handling
if (plugin.actions) {
for (const action of plugin.actions) {
try {
this.registerAction(action);
} catch (error) {
elizaLogger.warn(`Failed to register action from plugin: ${error.message}`);
}
}
}

plugin.services?.forEach((service) => {
this.registerService(service);
});
if (plugin.evaluators) {
for (const evaluator of plugin.evaluators) {
try {
this.registerEvaluator(evaluator);
} catch (error) {
elizaLogger.warn(`Failed to register evaluator from plugin: ${error.message}`);
}
}
}

plugin.providers?.forEach((provider) => {
this.registerContextProvider(provider);
});
});
if (plugin.services) {
for (const service of plugin.services) {
try {
this.registerService(service);
} catch (error) {
elizaLogger.warn(`Failed to register service from plugin: ${error.message}`);
}
}
}

if (plugin.providers) {
for (const provider of plugin.providers) {
try {
this.registerContextProvider(provider);
} catch (error) {
elizaLogger.warn(`Failed to register provider from plugin: ${error.message}`);
}
}
}
} catch (error) {
elizaLogger.warn(`Failed to process plugin: ${error.message}`);
}
}
} catch (error) {
elizaLogger.warn('Failed to initialize plugins, continuing without plugins');
this.plugins = [];
}
}

(opts.actions ?? []).forEach((action) => {
this.registerAction(action);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"target": "ESNext",
"module": "ESNext",
"lib": ["ESNext", "dom"],
"moduleResolution": "Bundler",
"moduleResolution": "bundler",
"outDir": "./dist",
"rootDir": "./src",
"strict": false,
Expand Down
14 changes: 12 additions & 2 deletions packages/plugin-lightning/src/actions/payInvoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ModelClass,
elizaLogger,
} from "@elizaos/core";
import { z } from "zod";

import {
initLightningProvider,
Expand Down Expand Up @@ -73,11 +74,20 @@ export const payInvoiceAction = {
state,
template: payInvoiceTemplate,
});
const content = await generateObject({

const payInvoiceSchema = z.object({
request: z.string(),
outgoing_channel: z.string()
});

const { object } = await generateObject({
runtime,
context: payInvoiceContext,
modelClass: ModelClass.LARGE,
});
schema: payInvoiceSchema
}) as { object: z.infer<typeof payInvoiceSchema> };

const content = object;

const payInvoiceOptions: PayArgs = {
request: content.request,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-pyth-data/schema.json

Large diffs are not rendered by default.

Loading
Loading