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

feat: integration tests fixes + library improvements #1177

Merged
merged 14 commits into from
Dec 18, 2024
Prev Previous commit
Next Next commit
Fixes
jzvikart committed Dec 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 87f862f0cb6bab0255cd345af7a575e32f0069bb
14 changes: 9 additions & 5 deletions tests/testLibrary.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { spawn } from 'node:child_process';
import { stringToUuid } from '../packages/core/dist/index.js';
import { spawn } from "node:child_process";
import { stringToUuid } from "../packages/core/dist/index.js";
import path from "path";

export const DEFAULT_CHARACTER = "trump"
export const DEFAULT_AGENT_ID = stringToUuid(DEFAULT_CHARACTER ?? uuidv4());
@@ -46,9 +47,12 @@ async function writeEnvFile(entries) {

async function startAgent(character = DEFAULT_CHARACTER) {
log(`Starting agent for character: ${character}`);
const proc = spawn("pnpm", ["start", `--character=characters/${character}.character.json`, '--non-interactive'], { shell: true, "stdio": "inherit" });
const proc = spawn("pnpm", ["start", `--character=characters/${character}.character.json`, '--non-interactive'], {
cwd: projectRoot(),
shell: true,
stdio: "inherit"
});
log(`proc=${JSON.stringify(proc)}`);

const startTime = Date.now();
const url = "http://127.0.0.1:3000/";
while (true) {
@@ -110,7 +114,7 @@ async function runIntegrationTest(fn) {
fn();
log("✓ Test passed");
} catch (error) {
logError(`✗ Test failed: ${error.message}`);
log("✗ Test failed");
logError(error);
process.exit(1);
} finally {

Unchanged files with check annotations Beta

try {
const guilds = (await rest.get(Routes.userGuilds())) as Array<any>;
res.json({

Check warning on line 104 in packages/client-direct/src/api.ts

GitHub Actions / check

Unexpected any. Specify a different type
id: runtime.agentId,
guilds: guilds,
serverCount: guilds.length,
export class DirectClient {
public app: express.Application;
private agents: Map<string, AgentRuntime>; // container management
private server: any; // Store server instance

Check warning on line 57 in packages/client-direct/src/index.ts

GitHub Actions / check

Unexpected any. Specify a different type
public startAgent: Function; // Store startAgent functor
constructor() {
amount: string | number;
}
function isTransferContent(content: any): content is TransferContent {

Check warning on line 30 in packages/plugin-aptos/src/actions/transfer.ts

GitHub Actions / check

Unexpected any. Specify a different type
console.log("Content for transfer", content);
return (
typeof content.recipient === "string" &&
console.log(" pnpm install");
console.log(" pnpm start");
}
} catch (error: any) {

Check warning on line 55 in packages/create-eliza-app/src/index.ts

GitHub Actions / check

Unexpected any. Specify a different type
console.error(
"Error:",
"message" in error ? error.message : "unknown error"
runtime: IAgentRuntime,
message: Memory,
state: State,
options: any,

Check warning on line 136 in packages/client-discord/src/actions/chat_with_attachments.ts

GitHub Actions / check

Unexpected any. Specify a different type
callback: HandlerCallback
) => {
state = (await runtime.composeState(message)) as State;
runtime: IAgentRuntime,
message: Memory,
state: State,
options: any,

Check warning on line 88 in packages/client-discord/src/actions/download_media.ts

GitHub Actions / check

Unexpected any. Specify a different type
callback: HandlerCallback
) => {
const videoService = runtime
runtime: IAgentRuntime,
message: Memory,
state: State,
options: any,

Check warning on line 196 in packages/client-discord/src/actions/summarize_conversation.ts

GitHub Actions / check

Unexpected any. Specify a different type
callback: HandlerCallback
) => {
state = (await runtime.composeState(message)) as State;
runtime: IAgentRuntime,
message: Memory,
state: State,
options: any,

Check warning on line 110 in packages/client-discord/src/actions/transcribe_media.ts

GitHub Actions / check

Unexpected any. Specify a different type
callback: HandlerCallback
) => {
state = (await runtime.composeState(message)) as State;
}
}
private async onClientReady(readyClient: { user: { tag: any; id: any } }) {

Check warning on line 128 in packages/client-discord/src/index.ts

GitHub Actions / check

Unexpected any. Specify a different type

Check warning on line 128 in packages/client-discord/src/index.ts

GitHub Actions / check

Unexpected any. Specify a different type
elizaLogger.success(`Logged in as ${readyClient.user?.tag}`);
// Register slash commands
const nickname = member?.nickname;
const memberId = member?.id;
// Don't consider role mentions as direct mentions

Check failure on line 517 in packages/client-discord/src/messages.ts

GitHub Actions / check

'memberId' is assigned a value but never used. Allowed unused vars must match /^_/u
const hasRoleMentionOnly = message.mentions.roles.size > 0 && !isMentioned;
// If it's only a role mention and we're in team mode, let team logic handle it